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

Re: [PATCH] t3700: avoid suppressing git's exit code

From
Johannes Sixt <j6t@kdbg.org>
Date
Feb 28, 2026, 08:12 UTC
Message-ID
<3c854150-2efc-4f5b-8a75-bb40808babd0@kdbg.org>
In-Reply-To
<20260227165143.70188-1-r.siddharth.shrimali@gmail.com>
Am 27.02.26 um 17:51 schrieb Siddharth Shrimali:
Show 9 quoted lines
> @@ -536,9 +544,9 @@ test_expect_success 'all statuses changed in folder if . is given' '
>  		touch x y z sub/a sub/dir/b &&
>  		git add -A &&
>  		git add --chmod=+x . &&
> -		test $(git ls-files --stage | grep ^100644 | wc -l) -eq 0 &&
> +		test $(git ls-files --stage >actual && grep ^100644 actual | wc -l) -eq 0 &&
>  		git add --chmod=-x . &&
> -		test $(git ls-files --stage | grep ^100755 | wc -l) -eq 0
> +		test $(git ls-files --stage >actual && grep ^100755 actual | wc -l) -eq 0

This doesn't help. The exit code of $( ) that is substituted into a command is ignored, too. You must move the git invocation out of the subshell.

Show 10 quoted lines
>  	)
>  '
>  
> @@ -574,4 +582,4 @@ test_expect_success CASE_INSENSITIVE_FS 'path is case-insensitive' '
>  	git add "$downcased"
>  '
>  
> -test_done
> +test_done
> \ No newline at end of file
Please keep the newline at the end of file.
-- Hannes
Previous: Junio C HamanoNext: Siddharth Shrimali
Message 5 of 6 in “t3700: avoid suppressing git's exit code”
  1. t3700: avoid suppressing git's exit codeSiddharth Shrimali, Feb 27, 2026
  2. Junio C HamanoFeb 27, 2026
  3. t3700: avoid hidden failures and use test_grep helperSiddharth Shrimali, Feb 28, 2026
  4. Junio C HamanoMar 2, 2026
  5. Johannes SixtFeb 28, 2026
  6. Siddharth ShrimaliFeb 28, 2026

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.