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

[PATCH 2/2] Fix t3404 assumption that `wc -l` does not use whitespace.

From
Brian Gernhardt <benji@silverinsanity.com>
Date
Apr 27, 2008, 15:16 UTC
Message-ID
<20080427151610.GB57955@Hermes.local>

t3404-rebase-interactive used `grep -Fx 0` to match against `wc -l` output. This fails on OS X and any other system where wc outputs whitespace. Use `test 0 = `... instead, like we do in other tests.

Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
---
 Should this construct go into CodingStyle?  I seem to have to write
 patches like this every month or so.
 t/t3404-rebase-interactive.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index d20ed4f..f204284 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -211,7 +211,7 @@ test_expect_success 'setting marks works' '
 	test "$(git rev-parse HEAD~2)" = \
 		"$(git rev-parse refs/rebase-marks/42)" &&
 	git rebase --abort &&
-	ls $marks_dir | wc -l | grep -Fx 0
+	test 0 = $(ls $marks_dir | wc -l)
 '
 
 test_expect_success 'reset with nonexistent mark fails' '
-- 
1.5.5.1.174.g8f57349
Next: Johannes Schindelin
Message 1 of 23 in “Fix t3404 assumption that `wc -l` does not use whitespace.”
  1. 2/2 Fix t3404 assumption that `wc -l` does not use whitespace.Brian Gernhardt, Apr 27, 2008
  2. Johannes SchindelinApr 27, 2008
  3. Brian GernhardtApr 27, 2008
  4. Jeff KingApr 28, 2008
  5. Mike RalphsonApr 28, 2008
  6. Jeff KingMay 13, 2008
  7. Mike RalphsonMay 13, 2008
  8. Mike RalphsonMay 15, 2008
  9. Jeff KingMay 15, 2008
  10. Jeff KingMay 15, 2008
  11. Junio C HamanoMay 15, 2008
  12. Mike RalphsonMay 16, 2008
  13. Brian GernhardtApr 28, 2008
  14. Junio C HamanoApr 27, 2008
  15. Johannes SchindelinApr 28, 2008
  16. Jörg SommerApr 28, 2008
  17. Johannes SchindelinApr 28, 2008
  18. Jörg SommerApr 28, 2008
  19. Johannes SchindelinApr 28, 2008
  20. Junio C HamanoApr 28, 2008
  21. Johannes SchindelinApr 28, 2008
  22. Junio C HamanoApr 28, 2008
  23. Johannes SchindelinApr 28, 2008

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.