From: Đoàn Trần Công Danh Date: Mon, 20 Apr 2020 23:54:34 +0000 (+0700) Subject: t4254: merge 2 steps of a single test X-Git-Tag: v2.27.0-rc0~62^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2ed282cc0d541d665dc7561ff962566378328bd6;p=thirdparty%2Fgit.git 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 Signed-off-by: Junio C Hamano --- diff --git a/t/t4254-am-corrupt.sh b/t/t4254-am-corrupt.sh index fd3bdbfe2c..ddd35498db 100755 --- a/t/t4254-am-corrupt.sh +++ b/t/t4254-am-corrupt.sh @@ -25,10 +25,8 @@ test_expect_success setup ' # fatal: unable to write file '(null)' mode 100644: Bad address # Also, it had the unwanted side-effect of deleting f. test_expect_success 'try to apply corrupted patch' ' - test_must_fail git -c advice.amWorkDir=false am bad-patch.diff 2>actual -' - -test_expect_success 'compare diagnostic; ensure file is still here' ' + test_when_finished "git am --abort" && + test_must_fail git -c advice.amWorkDir=false am bad-patch.diff 2>actual && echo "error: git diff header lacks filename information (line 4)" >expected && test_path_is_file f && test_i18ncmp expected actual