summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-07-16 11:17:36 -0700
committerJunio C Hamano <gitster@pobox.com>2014-07-16 11:17:36 -0700
commit2e931843adb7ce59b5d9bc76f72edff7805980a9 (patch)
tree2812da69ecfcc8f983e10bab9fba9a8a65c61df1 /builtin
parent588de86f06c897713d0a6b362629ff7d4911dd7c (diff)
parent60a5f5fc791d6c133732238736ef0961df600296 (diff)
downloadgit-2e931843adb7ce59b5d9bc76f72edff7805980a9.tar.gz
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
Diffstat (limited to 'builtin')
-rw-r--r--builtin/clone.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/clone.c b/builtin/clone.c
index 9b3c04d914..545105a86f 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -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