Skip to content

Commit 3ea9741

Browse files
avargitster
authored andcommitted
fetch tests: add a test clobbering tag behavior
The test suite only incidentally (and unintentionally) tested for the current behavior of eager tag clobbering on "fetch". This follow-up to the previous "push tests: assert re-pushing annotated tags" change tests for it explicitly. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c800aeb commit 3ea9741

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

t/t5516-fetch-push.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,6 +1011,30 @@ test_force_push_tag () {
10111011
test_force_push_tag "lightweight tag" "-f"
10121012
test_force_push_tag "annotated tag" "-f -a -m'msg'"
10131013

1014+
test_force_fetch_tag () {
1015+
tag_type_description=$1
1016+
tag_args=$2
1017+
1018+
test_expect_success "fetch will clobber an existing $tag_type_description" "
1019+
mk_test testrepo heads/master &&
1020+
mk_child testrepo child1 &&
1021+
mk_child testrepo child2 &&
1022+
(
1023+
cd testrepo &&
1024+
git tag Tag &&
1025+
git -C ../child1 fetch origin tag Tag &&
1026+
>file1 &&
1027+
git add file1 &&
1028+
git commit -m 'file1' &&
1029+
git tag $tag_args Tag &&
1030+
git -C ../child1 fetch origin tag Tag
1031+
)
1032+
"
1033+
}
1034+
1035+
test_force_fetch_tag "lightweight tag" "-f"
1036+
test_force_fetch_tag "annotated tag" "-f -a -m'msg'"
1037+
10141038
test_expect_success 'push --porcelain' '
10151039
mk_empty testrepo &&
10161040
echo >.git/foo "To testrepo" &&

0 commit comments

Comments
 (0)