clone --mirror: avoid storing repeated tags
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>
This commit is contained in:
parent
1fdf6ee6f8
commit
468386a956
@ -330,6 +330,7 @@ static struct ref *write_remote_refs(const struct ref *refs,
|
|||||||
struct ref *r;
|
struct ref *r;
|
||||||
|
|
||||||
get_fetch_map(refs, refspec, &tail, 0);
|
get_fetch_map(refs, refspec, &tail, 0);
|
||||||
|
if (!option_mirror)
|
||||||
get_fetch_map(refs, tag_refspec, &tail, 0);
|
get_fetch_map(refs, tag_refspec, &tail, 0);
|
||||||
|
|
||||||
for (r = local_refs; r; r = r->next)
|
for (r = local_refs; r; r = r->next)
|
||||||
|
@ -95,4 +95,16 @@ test_expect_success 'clone --bare names the local repository <name>.git' '
|
|||||||
|
|
||||||
'
|
'
|
||||||
|
|
||||||
|
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
|
test_done
|
||||||
|
Loading…
Reference in New Issue
Block a user