Skip to content

Commit 5c2303e

Browse files
avargitster
authored andcommitted
mktag tests: don't create "mytag" twice
Change a test added in e0aaf78 (mktag.c: improve verification of tagger field and tests, 2008-03-27) to not create "mytag", which should only be created and verified at the end in an earlier test added in 446c6fa (New tests and en-passant modifications to mktag., 2006-07-29). While we're at it let's prevent a similar logic error from creeping into the test by asserting that "mytag" doesn't exist before we create it. Let's do this by moving the test to use "update-ref", instead of our own homebrew ad-hoc refstore update. We're not really testing for anything yet by creating the tag at the end here. A subsequent commit will change that. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 317c176 commit 5c2303e

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

t/t3800-mktag.sh

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ EOF
222222

223223
test_expect_success \
224224
'allow empty tag email' \
225-
'git mktag <tag.sig >.git/refs/tags/mytag'
225+
'git mktag <tag.sig'
226226

227227
############################################################
228228
# 16. disallow spaces in tag email
@@ -348,16 +348,9 @@ tagger T A Gger <[email protected]> 1206478233 -0500
348348
349349
EOF
350350

351-
test_expect_success \
352-
'create valid tag' \
353-
'git mktag <tag.sig >.git/refs/tags/mytag'
354-
355-
############################################################
356-
# 25. check mytag
357-
358-
test_expect_success \
359-
'check mytag' \
360-
'git tag -l | grep mytag'
361-
351+
test_expect_success 'create valid tag' '
352+
git mktag <tag.sig >hash &&
353+
git update-ref refs/tags/mytag $(cat hash) $(test_oid zero)
354+
'
362355

363356
test_done

0 commit comments

Comments
 (0)