Skip to content

Commit

Permalink
Merge branch 'jc/fix-clone-single-starting-at-a-tag' into maint
Browse files Browse the repository at this point in the history
"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
  • Loading branch information
Junio C Hamano committed Jul 16, 2014
2 parents 588de86 + 60a5f5f commit 2e93184
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion builtin/clone.c
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ static void write_refspec_config(const char* src_ref_prefix,
if (option_mirror || !option_bare) {
if (option_single_branch && !option_mirror) {
if (option_branch) {
if (strstr(our_head_points_at->name, "refs/tags/"))
if (starts_with(our_head_points_at->name, "refs/tags/"))
strbuf_addf(&value, "+%s:%s", our_head_points_at->name,
our_head_points_at->name);
else
Expand Down

0 comments on commit 2e93184

Please sign in to comment.