summaryrefslogtreecommitdiff
path: root/builtin/clone.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2012-07-11 12:48:29 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2012-07-11 12:48:29 -0700
commit4ac01b0cbc27b314333362e77323850e78a7448c (patch)
tree7f99def2b5c3bfe2973139de2c801862c6949f44 /builtin/clone.c
parentMerge branch 'jc/rev-list-simplify-merges-first-parent' into maint (diff)
parentclone: fix ref selection in --single-branch --branch=xxx (diff)
downloadtgif-4ac01b0cbc27b314333362e77323850e78a7448c.tar.xz
Merge branch 'nd/clone-single-fix' into maint
"git clone --single-branch" to clone a single branch did not limit the cloning to the specified branch. * nd/clone-single-fix: clone: fix ref selection in --single-branch --branch=xxx
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 a4d8d25ee3..f86aaf18f7 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."),