summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2014-07-10 11:17:24 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2014-07-10 11:17:24 -0700
commit3d77f72efe79eb90f67aec9ecf6d4bd11fc9a78c (patch)
tree5946e9a1e4872fc28c496d1e1387d1c9916d2cd8
parentSixth batch for 2.1 (diff)
parentbuiltin/clone.c: detect a clone starting at a tag correctly (diff)
downloadtgif-3d77f72efe79eb90f67aec9ecf6d4bd11fc9a78c.tar.xz
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
-rw-r--r--builtin/clone.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/clone.c b/builtin/clone.c
index a5b2d9db36..e15ca332b5 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -696,7 +696,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