diff options
| author | Frank Li <lznuaa@gmail.com> | 2013-01-27 15:02:06 +0800 |
|---|---|---|
| committer | Frank Li <lznuaa@gmail.com> | 2013-01-27 15:02:06 +0800 |
| commit | 28c3beaa59f4b83bb3fa82e806579be9e2d8b73b (patch) | |
| tree | 322df5e5ebd457ece971ffb37d6fc3ebe54785c4 /src/clone.c | |
| parent | 88183c1988ff1c8b1bbe956e0df6d2c10e5a12b2 (diff) | |
| download | libgit2-28c3beaa59f4b83bb3fa82e806579be9e2d8b73b.tar.gz | |
Fix fail clone local repo which head detatched
Set head detach if can't found branch after download
Signed-off-by: Frank Li <lznuaa@gmail.com>
Diffstat (limited to 'src/clone.c')
| -rw-r--r-- | src/clone.c | 6 |
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: |
