summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1fdf6ee)
raw | patch | inline | side by side (parent: 1fdf6ee)
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Fri, 8 Aug 2008 02:29:35 +0000 (04:29 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 8 Aug 2008 04:25:27 +0000 (21:25 -0700) |
With --mirror, clone asks for refs/* already, so it does not need to
ask for ref/tags/*, too.
Noticed by Cesar Eduardo Barros.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
ask for ref/tags/*, too.
Noticed by Cesar Eduardo Barros.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-clone.c | patch | blob | history | |
t/t5601-clone.sh | patch | blob | history |
diff --git a/builtin-clone.c b/builtin-clone.c
index 8612d59dd22202bc8af3436bffcade2e2dba5fcf..c0e3086437ced05d1b81d4098e3a4c7c3031b0ee 100644 (file)
--- a/builtin-clone.c
+++ b/builtin-clone.c
struct ref *r;
get_fetch_map(refs, refspec, &tail, 0);
- get_fetch_map(refs, tag_refspec, &tail, 0);
+ if (!option_mirror)
+ get_fetch_map(refs, tag_refspec, &tail, 0);
for (r = local_refs; r; r = r->next)
add_extra_ref(r->peer_ref->name, r->old_sha1, 0);
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index a13b6f9d3d9c0735ce87c82150283727fab8e378..59c65fef286ad8d52a15c942f6975607f0347f66 100755 (executable)
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
'
+test_expect_success 'clone --mirror does not repeat tags' '
+
+ (cd src &&
+ git tag some-tag HEAD) &&
+ git clone --mirror src mirror2 &&
+ (cd mirror2 &&
+ git show-ref 2> clone.err > clone.out) &&
+ test_must_fail grep Duplicate mirror2/clone.err &&
+ grep some-tag mirror2/clone.out
+
+'
+
test_done