summaryrefslogtreecommitdiff
path: root/src/libgit2/clone.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libgit2/clone.c')
-rw-r--r--src/libgit2/clone.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libgit2/clone.c b/src/libgit2/clone.c
index 1843875f8..0d393eb85 100644
--- a/src/libgit2/clone.c
+++ b/src/libgit2/clone.c
@@ -282,7 +282,11 @@ static int update_head_to_branch(
reflog_message)) < 0)
goto cleanup;
- if ((retcode = git_remote__default_branch(&default_branch, remote)) < 0)
+ retcode = git_remote__default_branch(&default_branch, remote);
+
+ if (retcode == GIT_ENOTFOUND)
+ retcode = 0;
+ else if (retcode)
goto cleanup;
if (!git_remote__matching_refspec(remote, git_str_cstr(&default_branch)))