From: Philip Peterson via GitGitGadget Date: Sun, 18 Feb 2024 07:33:30 GMT Subject: [PATCH 3/5] apply: update t4012 test suite Message-ID: <2da1b6509d810c76e5ea753a91b6a3a46a73fa6c.1708241613.git.gitgitgadget@gmail.com> In-Reply-To: From: Philip Peterson The test suite matched against a regex that expected the entire errored output to end before the additional context added to `git apply`. Signed-off-by: Philip Peterson --- t/t4012-diff-binary.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t4012-diff-binary.sh b/t/t4012-diff-binary.sh index c64d9d2f405..59defaa37b8 100755 --- a/t/t4012-diff-binary.sh +++ b/t/t4012-diff-binary.sh @@ -68,7 +68,7 @@ test_expect_success 'apply detecting corrupt patch correctly' ' git diff >output && sed -e "s/-CIT/xCIT/" broken && test_must_fail git apply --stat --summary broken 2>detected && - detected=$(cat detected) && + detected=$(head -n 1 detected) && detected=$(expr "$detected" : "error.*at line \\([0-9]*\\)\$") && detected=$(sed -ne "${detected}p" broken) && test "$detected" = xCIT @@ -77,7 +77,7 @@ test_expect_success 'apply detecting corrupt patch correctly' ' test_expect_success 'apply detecting corrupt patch correctly' ' git diff --binary | sed -e "s/-CIT/xCIT/" >broken && test_must_fail git apply --stat --summary broken 2>detected && - detected=$(cat detected) && + detected=$(head -n 1 detected) && detected=$(expr "$detected" : "error.*at line \\([0-9]*\\)\$") && detected=$(sed -ne "${detected}p" broken) && test "$detected" = xCIT -- gitgitgadget