Skip to content

Commit 4551d03

Browse files
trastgitster
authored andcommitted
t1450: fix testcases that were wrongly expecting failure
Almost exactly a year ago in 02a6552 (Test fsck a bit harder), I introduced two testcases that were expecting failure. However, the only bug was that the testcases wrote *blobs* because I forgot to pass -t tag to hash-object. Fix this, and then adjust the rest of the test to properly check the result. Signed-off-by: Thomas Rast <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e9e9219 commit 4551d03

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

t/t1450-fsck.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ tagger T A Gger <[email protected]> 1234567890 -0000
6666
This is an invalid tag.
6767
EOF
6868

69-
test_expect_failure 'tag pointing to nonexistent' '
70-
tag=$(git hash-object -w --stdin < invalid-tag) &&
69+
test_expect_success 'tag pointing to nonexistent' '
70+
tag=$(git hash-object -t tag -w --stdin < invalid-tag) &&
7171
echo $tag > .git/refs/tags/invalid &&
72-
git fsck --tags 2>out &&
72+
test_must_fail git fsck --tags >out &&
7373
cat out &&
74-
grep "could not load tagged object" out &&
74+
grep "broken link" out &&
7575
rm .git/refs/tags/invalid
7676
'
7777

@@ -84,12 +84,12 @@ tagger T A Gger <[email protected]> 1234567890 -0000
8484
This is an invalid tag.
8585
EOF
8686

87-
test_expect_failure 'tag pointing to something else than its type' '
88-
tag=$(git hash-object -w --stdin < wrong-tag) &&
87+
test_expect_success 'tag pointing to something else than its type' '
88+
tag=$(git hash-object -t tag -w --stdin < wrong-tag) &&
8989
echo $tag > .git/refs/tags/wrong &&
90-
git fsck --tags 2>out &&
90+
test_must_fail git fsck --tags 2>out &&
9191
cat out &&
92-
grep "some sane error message" out &&
92+
grep "error in tag.*broken links" out &&
9393
rm .git/refs/tags/wrong
9494
'
9595

0 commit comments

Comments
 (0)