Skip to content

Commit 2e93184

Browse files
committed
Merge branch 'jc/fix-clone-single-starting-at-a-tag' into maint
"git clone -b brefs/tags/bar" would have mistakenly thought we were following a single tag, even though it was a name of the branch, because it incorrectly used strstr(). * jc/fix-clone-single-starting-at-a-tag: builtin/clone.c: detect a clone starting at a tag correctly
2 parents 588de86 + 60a5f5f commit 2e93184

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/clone.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ static void write_refspec_config(const char* src_ref_prefix,
695695
if (option_mirror || !option_bare) {
696696
if (option_single_branch && !option_mirror) {
697697
if (option_branch) {
698-
if (strstr(our_head_points_at->name, "refs/tags/"))
698+
if (starts_with(our_head_points_at->name, "refs/tags/"))
699699
strbuf_addf(&value, "+%s:%s", our_head_points_at->name,
700700
our_head_points_at->name);
701701
else

0 commit comments

Comments
 (0)