Skip to content

Commit 2ed282c

Browse files
sgngitster
authored andcommitted
t4254: merge 2 steps of a single test
While we are at it, make sure we run a clean up after testing. In a later patch, we will test for more corrupted patch. Signed-off-by: Đoàn Trần Công Danh <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent af6b65d commit 2ed282c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

t/t4254-am-corrupt.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,8 @@ test_expect_success setup '
2525
# fatal: unable to write file '(null)' mode 100644: Bad address
2626
# Also, it had the unwanted side-effect of deleting f.
2727
test_expect_success 'try to apply corrupted patch' '
28-
test_must_fail git -c advice.amWorkDir=false am bad-patch.diff 2>actual
29-
'
30-
31-
test_expect_success 'compare diagnostic; ensure file is still here' '
28+
test_when_finished "git am --abort" &&
29+
test_must_fail git -c advice.amWorkDir=false am bad-patch.diff 2>actual &&
3230
echo "error: git diff header lacks filename information (line 4)" >expected &&
3331
test_path_is_file f &&
3432
test_i18ncmp expected actual

0 commit comments

Comments
 (0)