summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Straub <bs@github.com>2012-12-15 14:30:20 -0800
committerBen Straub <bs@github.com>2012-12-15 14:30:20 -0800
commit2a2d1ab0867a43fe9a206c20d3d34bab57a2fb06 (patch)
treea0beb015cde7d59dddc439159af4ec4fcf2a9a4e
parent28abb187c468f9dfc4bab9353fe4c8485ca09099 (diff)
downloadlibgit2-2a2d1ab0867a43fe9a206c20d3d34bab57a2fb06.tar.gz
Cloning empty repos: only allow missing target for HEAD
-rw-r--r--src/transports/local.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/transports/local.c b/src/transports/local.c
index b5b1dd06d..c6c95ce75 100644
--- a/src/transports/local.c
+++ b/src/transports/local.c
@@ -54,9 +54,9 @@ static int add_ref(transport_local *t, const char *name)
if (error < 0) {
git__free(head->name);
git__free(head);
- if (error == GIT_ENOTFOUND) {
+ if (!strcmp(name, GIT_HEAD_FILE) && error == GIT_ENOTFOUND) {
/* This is actually okay. Empty repos often have a HEAD that points to
- * a nonexistant "refs/haeds/master". */
+ * a nonexistent "refs/heads/master". */
giterr_clear();
return 0;
}