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

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

From
Siddharth Shrimali <r.siddharth.shrimali@gmail.com>
Date
Feb 28, 2026, 10:15 UTC
Message-ID
<CAGWgyh8CnJSk53rXFcFgnM++6o1ZWTLnRzXhY4VwkNyY0-W+UQ@mail.gmail.com>
In-Reply-To
<3c854150-2efc-4f5b-8a75-bb40808babd0@kdbg.org>
Hi Hannes,
Thank you for the review!

It looks like our emails crossed paths; I sent out a v2 [1] just before your comments arrived. In that version, I have addressed both of your points:

1. Moved the git invocations out of the subshells and replaced
   the logic with 'test_grep !' to properly catch exit codes.
2. Restored the trailing newline at the end of the file.
[1] https://lore.kernel.org/git/20260228070020.89668-1-r.siddharth.shrimali@gmail.com/

Best regards, Siddharth

On Sat, 28 Feb 2026 at 13:42, Johannes Sixt <j6t@kdbg.org> wrote:
Show 31 quoted lines
>
> Am 27.02.26 um 17:51 schrieb Siddharth Shrimali:
> > @@ -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.
>
> >       )
> >  '
> >
> > @@ -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: Johannes Sixt
Message 6 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.