]> git.ipfire.org Git - thirdparty/git.git/commit
t3700: avoid suppressing git's exit code
authorSiddharth Shrimali <r.siddharth.shrimali@gmail.com>
Tue, 3 Mar 2026 20:40:28 +0000 (02:10 +0530)
committerJunio C Hamano <gitster@pobox.com>
Tue, 3 Mar 2026 21:29:28 +0000 (13:29 -0800)
commitfc2ead0053d31735ac4a02c370c5c2b6dbaf2bbe
treedd41cd7d8e6bb90148701d8c29b61d51b6e7201d
parent67ad42147a7acc2af6074753ebd03d904476118f
t3700: avoid suppressing git's exit code

Replace pipelines involving git commands with temporary files (actual)
to ensure that any crashes or unexpected exit codes from the git
commands are properly caught by the test suite. A simple pipeline
like 'git foo | grep bar' ignores the exit code of 'git', which
can hide regressions.

In cases where we were counting lines with 'wc -l' to ensure a
pattern was absent, simplify the logic to use '! grep' to avoid
subshells entirely.

Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Siddharth Shrimali <r.siddharth.shrimali@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t3700-add.sh