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>
This commit is contained in:

committed by
Junio C Hamano

parent
785ee4960c
commit
0ec4b1650c
@ -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."),
|
||||
|
Reference in New Issue
Block a user