Skip to content

Commit b08d82f

Browse files
j6tpeff
authored andcommitted
modernize t9300: use test_must_fail
One test case open-codes a test for an expected failure. Replace it by test_must_fail. Signed-off-by: Johannes Sixt <[email protected]> Signed-off-by: Jeff King <[email protected]>
1 parent d67824f commit b08d82f

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

t/t9300-fast-import.sh

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -630,20 +630,9 @@ from refs/heads/branch
630630
631631
INPUT_END
632632
test_expect_success 'F: non-fast-forward update skips' '
633-
if git fast-import <input
634-
then
635-
echo BAD gfi did not fail
636-
return 1
637-
else
638-
if test $old_branch = `git rev-parse --verify branch^0`
639-
then
640-
: branch unaffected and failure returned
641-
return 0
642-
else
643-
echo BAD gfi changed branch $old_branch
644-
return 1
645-
fi
646-
fi
633+
test_must_fail git fast-import <input &&
634+
# branch must remain unaffected
635+
test $old_branch = `git rev-parse --verify branch^0`
647636
'
648637

649638
test_expect_success 'F: verify pack' '

0 commit comments

Comments
 (0)