summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBen Straub <bs@github.com>2013-02-01 09:41:50 -0800
committerBen Straub <bs@github.com>2013-02-01 09:41:50 -0800
commit329eee33871cc03133f5166a4e2908011f06b5b1 (patch)
treeb2dffdb43257a1b74441b47afb9a13d17e144e14 /src
parent7c32a0b5f7cc3eeb0ea1f12e6d2bc0839a7f28ef (diff)
parentaa928de02a85810b0fd62a35e1af68768e0dab78 (diff)
downloadlibgit2-329eee33871cc03133f5166a4e2908011f06b5b1.tar.gz
Merge pull request #1286 from lznuaa/master
Fix clone fail if repo head detached
Diffstat (limited to 'src')
-rw-r--r--src/clone.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/clone.c b/src/clone.c
index d60977a3f..333bf2148 100644
--- a/src/clone.c
+++ b/src/clone.c
@@ -250,8 +250,10 @@ static int update_head_to_remote(git_repository *repo, git_remote *remote)
goto cleanup;
} else {
- /* TODO: What should we do if nothing has been found?
- */
+ retcode = git_repository_set_head_detached(
+ repo,
+ &head_info.remote_head_oid);
+ goto cleanup;
}
cleanup: