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>
SZEDER Gábor committed
Dec 8, 2016 at 15:23 UTC
eba286e31012335370aedb7572ff51df549eb3f3
1 file changed
+1
-1
t/t7004-tag.sh
+1
-1
@@ -122,11 +122,11 @@ test_expect_success '--force can create a tag with the name of one existing' '
122
tag_exists mytag'
123
124
test_expect_success '--force is moot with a non-existing tag name' '
125
+ test_when_finished git tag -d newtag forcetag &&
126
git tag newtag >expect &&
127
git tag --force forcetag >actual &&
128
test_cmp expect actual
129
'
129
-git tag -d newtag forcetag
130
131
# deleting tags:
132