Skip to content

Commit

Permalink
fetch tests: add a test clobbering tag behavior
Browse files Browse the repository at this point in the history
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 <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
avar authored and gitster committed May 8, 2018
1 parent d20cf81 commit 6ed3f67
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions t/t5516-fetch-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1003,6 +1003,30 @@ test_force_push_tag () {
test_force_push_tag "lightweight tag" "-f"
test_force_push_tag "annotated tag" "-f -a -m'msg'"

test_force_fetch_tag () {
tag_type_description=$1
tag_args=$2

test_expect_success "fetch will clobber an existing $tag_type_description" "
mk_test testrepo heads/master &&
mk_child testrepo child1 &&
mk_child testrepo child2 &&
(
cd testrepo &&
git tag Tag &&
git -C ../child1 fetch origin tag Tag &&
>file1 &&
git add file1 &&
git commit -m 'file1' &&
git tag $tag_args Tag &&
git -C ../child1 fetch origin tag Tag
)
"
}

test_force_fetch_tag "lightweight tag" "-f"
test_force_fetch_tag "annotated tag" "-f -a -m'msg'"

test_expect_success 'push --porcelain' '
mk_empty testrepo &&
echo >.git/foo "To testrepo" &&
Expand Down

0 comments on commit 6ed3f67

Please sign in to comment.