Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 3d77f72

Browse files
committed
Merge branch 'jc/fix-clone-single-starting-at-a-tag'
"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 81e776d + 60a5f5f commit 3d77f72

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
@@ -696,7 +696,7 @@ static void write_refspec_config(const char* src_ref_prefix,
696696
if (option_mirror || !option_bare) {
697697
if (option_single_branch && !option_mirror) {
698698
if (option_branch) {
699-
if (strstr(our_head_points_at->name, "refs/tags/"))
699+
if (starts_with(our_head_points_at->name, "refs/tags/"))
700700
strbuf_addf(&value, "+%s:%s", our_head_points_at->name,
701701
our_head_points_at->name);
702702
else

0 commit comments

Comments
 (0)