Skip to content

Commit eba286e

Browse files
szedergitster
authored andcommitted
t7004-tag: delete unnecessary tags with test_when_finished
The '--force is moot with a non-existing tag name' test creates two new tags, which are then deleted right after the test is finished, outside the test_expect_success block, allowing 'git tag -d's output to pollute the test output. Use test_when_finished to delete those tags. Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 8d7a455 commit eba286e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

t/t7004-tag.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,11 @@ test_expect_success '--force can create a tag with the name of one existing' '
122122
tag_exists mytag'
123123

124124
test_expect_success '--force is moot with a non-existing tag name' '
125+
test_when_finished git tag -d newtag forcetag &&
125126
git tag newtag >expect &&
126127
git tag --force forcetag >actual &&
127128
test_cmp expect actual
128129
'
129-
git tag -d newtag forcetag
130130

131131
# deleting tags:
132132

0 commit comments

Comments
 (0)