summaryrefslogtreecommitdiff
path: root/builtin/clone.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-07-10 11:17:24 -0700
committerJunio C Hamano <gitster@pobox.com>2014-07-10 11:17:24 -0700
commit3d77f72efe79eb90f67aec9ecf6d4bd11fc9a78c (patch)
tree5946e9a1e4872fc28c496d1e1387d1c9916d2cd8 /builtin/clone.c
parent81e776d92bb19a4fab12dcc537adfd543468d7d0 (diff)
parent60a5f5fc791d6c133732238736ef0961df600296 (diff)
downloadgit-3d77f72efe79eb90f67aec9ecf6d4bd11fc9a78c.tar.gz
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
Diffstat (limited to 'builtin/clone.c')
-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