Skip to content

Commit 6ed3f67

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 d20cf81 commit 6ed3f67

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
@@ -1003,6 +1003,30 @@ test_force_push_tag () {
10031003
test_force_push_tag "lightweight tag" "-f"
10041004
test_force_push_tag "annotated tag" "-f -a -m'msg'"
10051005

1006+
test_force_fetch_tag () {
1007+
tag_type_description=$1
1008+
tag_args=$2
1009+
1010+
test_expect_success "fetch will clobber an existing $tag_type_description" "
1011+
mk_test testrepo heads/master &&
1012+
mk_child testrepo child1 &&
1013+
mk_child testrepo child2 &&
1014+
(
1015+
cd testrepo &&
1016+
git tag Tag &&
1017+
git -C ../child1 fetch origin tag Tag &&
1018+
>file1 &&
1019+
git add file1 &&
1020+
git commit -m 'file1' &&
1021+
git tag $tag_args Tag &&
1022+
git -C ../child1 fetch origin tag Tag
1023+
)
1024+
"
1025+
}
1026+
1027+
test_force_fetch_tag "lightweight tag" "-f"
1028+
test_force_fetch_tag "annotated tag" "-f -a -m'msg'"
1029+
10061030
test_expect_success 'push --porcelain' '
10071031
mk_empty testrepo &&
10081032
echo >.git/foo "To testrepo" &&

0 commit comments

Comments
 (0)