From: Denton Liu Date: Tue, 7 Jan 2020 04:53:13 +0000 (-0500) Subject: t4124: only mark git command with test_must_fail X-Git-Tag: v2.26.0-rc0~61^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=37a63faae58aee5cd2dd9806d2e98c9ad998a7e5;p=thirdparty%2Fgit.git t4124: only mark git command with test_must_fail The test_must_fail function should only be used for git commands since we should assume that external commands work sanely. Since apply_patch wraps a sed and git invocation, rewrite it to accept an `!` argument which would cause only the git command to be prefixed with `test_must_fail`. Signed-off-by: Denton Liu Signed-off-by: Junio C Hamano --- diff --git a/t/t4124-apply-ws-rule.sh b/t/t4124-apply-ws-rule.sh index ff51e9e789..971a5a7512 100755 --- a/t/t4124-apply-ws-rule.sh +++ b/t/t4124-apply-ws-rule.sh @@ -35,9 +35,15 @@ prepare_test_file () { } apply_patch () { + cmd_prefix= && + if test "x$1" = 'x!' + then + cmd_prefix=test_must_fail && + shift + fi && >target && sed -e "s|\([ab]\)/file|\1/target|"