summaryrefslogtreecommitdiff
path: root/src/transports/local.c
diff options
context:
space:
mode:
authorBen Straub <bs@github.com>2012-12-13 12:55:28 -0800
committerBen Straub <bs@github.com>2012-12-14 13:58:44 -0800
commit850b1edfe8f04daaec05237e35e74f11600e5b4c (patch)
tree1d3556b4cfd4178548a510a331bcfc17232d51de /src/transports/local.c
parentbe5869fce0ab9c61a294020e9baa9755c58ee8a3 (diff)
downloadlibgit2-850b1edfe8f04daaec05237e35e74f11600e5b4c.tar.gz
Allow clone to handle empty repos
Diffstat (limited to 'src/transports/local.c')
-rw-r--r--src/transports/local.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/transports/local.c b/src/transports/local.c
index 53b24947c..8aeab2975 100644
--- a/src/transports/local.c
+++ b/src/transports/local.c
@@ -50,9 +50,11 @@ static int add_ref(transport_local *t, const char *name)
GITERR_CHECK_ALLOC(head->name);
if (git_reference_name_to_id(&head->oid, t->repo, name) < 0) {
+ /* This is actually okay. Empty repos often have a HEAD that points to
+ * a nonexistant "refs/haeds/master". */
git__free(head->name);
git__free(head);
- return -1;
+ return 0;
}
if (git_vector_insert(&t->refs, head) < 0)