summaryrefslogtreecommitdiff
path: root/builtin/clone.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2012-06-22 09:35:47 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-06-22 21:16:34 (GMT)
commit0ec4b1650ccac48513f8cfb00d0778ba1d3e8fca (patch)
tree6eb9e150867cb774caf7aa4399ac91e49ddd4967 /builtin/clone.c
parent785ee4960c3d334cbc2b17ab74d2cebdf1b4db64 (diff)
downloadgit-0ec4b1650ccac48513f8cfb00d0778ba1d3e8fca.zip
git-0ec4b1650ccac48513f8cfb00d0778ba1d3e8fca.tar.gz
git-0ec4b1650ccac48513f8cfb00d0778ba1d3e8fca.tar.bz2
clone: fix ref selection in --single-branch --branch=xxx
- do not fetch HEAD - do not also fetch refs following "xxx" Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/clone.c')
-rw-r--r--builtin/clone.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/builtin/clone.c b/builtin/clone.c
index a4d8d25..f86aaf1 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -433,8 +433,11 @@ static struct ref *wanted_peer_refs(const struct ref *refs,
if (!option_branch)
remote_head = guess_remote_head(head, refs, 0);
- else
- remote_head = find_remote_branch(refs, option_branch);
+ else {
+ local_refs = NULL;
+ tail = &local_refs;
+ remote_head = copy_ref(find_remote_branch(refs, option_branch));
+ }
if (!remote_head && option_branch)
warning(_("Could not find remote branch %s to clone."),