git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 3/5] apply: update t4012 test suite

From
PGPhilip Peterson via GitGitGadget <gitgitgadget@gmail.com>
Date
Feb 18, 2024, 07:33 UTC
Message-ID
<2da1b6509d810c76e5ea753a91b6a3a46a73fa6c.1708241613.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.1666.git.git.1708241612.gitgitgadget@gmail.com>
From: Philip Peterson <philip.c.peterson@gmail.com>

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 <philip.c.peterson@gmail.com>
---
 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/" <output >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
Previous: Philip Peterson via GitGitGadgetNext: Philip Peterson via GitGitGadget
Message 3 of 13 in “promise: introduce promises to track success or error”
  1. 0/5 promise: introduce promises to track success or errorPhilip Peterson via GitGitGadget, Feb 18, 2024
  2. 1/5 promise: add promise pattern to track success/error from operationsPhilip Peterson via GitGitGadget, Feb 18, 2024
  3. 3/5 apply: update t4012 test suitePhilip Peterson via GitGitGadget, Feb 18, 2024
  4. 2/5 apply: use new promise structures in git-apply logic as a proving groundPhilip Peterson via GitGitGadget, Feb 18, 2024
  5. 4/5 apply: pass through quiet flag to fix t4150Philip Peterson via GitGitGadget, Feb 18, 2024
  6. 5/5 am: update test t4254 by adding the new error textPhilip Peterson via GitGitGadget, Feb 18, 2024
  7. Phillip WoodFeb 19, 2024
  8. Jeff KingFeb 20, 2024
  9. Phillip WoodFeb 20, 2024
  10. Patrick SteinhardtFeb 20, 2024
  11. Junio C HamanoFeb 20, 2024
  12. Jeff KingFeb 21, 2024
  13. PhilipMar 12, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.