Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-07-05 10:41:41 +0400
committerJunio C Hamano <gitster@pobox.com>2012-07-05 10:41:41 +0400
commit57c054c5d0e72d5665322a4bebb7f380390edde5 (patch)
treea6dc5fc94f7a2c8c05a5d215ad7a73d2a1b7c858 /builtin/clone.c
parent60ad08bfdfe393fd86391e2f9e60e8ffccc78e5b (diff)
parent0ec4b1650ccac48513f8cfb00d0778ba1d3e8fca (diff)
Merge branch 'nd/clone-single-fix'
"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 7f3b9823ce..d3b7fdccec 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."),