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

Re: [PATCH] blame: prevent a segv when -L given start > EOF

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 9, 2010, 18:06 UTC
Message-ID
<7vhbpqe11y.fsf@alter.siamese.dyndns.org>
In-Reply-To
<76718491002090955g66eca03ar7438e57811616267@mail.gmail.com>

Sorry for knowing but forgetting about the issue while applying. I'll queue this fix-up.

-- >8 -- t8003: check exit code of command and error message separately

Shell reports exit status only from the most downstream command in a pipeline. In these tests, we want to make sure that the command fails in a controlled way, and produces a correct error message.

This issue was known by Jay who submitted the patch, and also was pointed out by Hannes during the review process, but I forgot to fix it up before applying. Sorry about that.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 t/t8003-blame.sh |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/t/t8003-blame.sh b/t/t8003-blame.sh
index 4a8db74..3bbddd0 100755
--- a/t/t8003-blame.sh
+++ b/t/t8003-blame.sh
@@ -158,11 +158,13 @@ EOF
 '
 
 test_expect_success 'blame -L with invalid start' '
-	test_must_fail git blame -L5 tres 2>&1 | grep "has only 2 lines"
+	test_must_fail git blame -L5 tres 2>errors &&
+	grep "has only 2 lines" errors
 '
 
 test_expect_success 'blame -L with invalid end' '
-	git blame -L1,5 tres 2>&1 | grep "has only 2 lines"
+	test_must_fail git blame -L1,5 tres 2>errors &&
+	grep "has only 2 lines" errors
 '
 
 test_done
Previous: Jay SoffianNext: Jay Soffian
Message 10 of 11 in “blame: prevent a segv when -L given start > EOF”
  1. blame: prevent a segv when -L given start > EOFJay Soffian, Feb 9, 2010
  2. Jay SoffianFeb 9, 2010
  3. Junio C HamanoFeb 9, 2010
  4. Jay SoffianFeb 9, 2010
  5. Jay SoffianFeb 9, 2010
  6. Jay SoffianFeb 9, 2010
  7. Junio C HamanoFeb 9, 2010
  8. Johannes SixtFeb 9, 2010
  9. Jay SoffianFeb 9, 2010
  10. Junio C HamanoFeb 9, 2010
  11. blame: prevent a segv when -L given start > EOFJay Soffian, Feb 9, 2010

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.