diff options
| author | Siddharth Shrimali <r.siddharth.shrimali@gmail.com> | 2026-04-14 19:48:28 +0530 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-04-14 10:05:15 -0700 |
| commit | 46106a48e5ba3603c000ca385029a76bec72c5bb (patch) | |
| tree | 5314197e8d3040942759f31919b6becedf6a7bb4 /t/t4013/diff.format-patch_--stdout_initial..main^ | |
| parent | 0a85ca10ea42141262f15441aa3acf0914bec7d9 (diff) | |
| download | git-46106a48e5ba3603c000ca385029a76bec72c5bb.tar.gz git-46106a48e5ba3603c000ca385029a76bec72c5bb.zip | |
t7004: avoid subshells to capture git exit codes
Several tests in t7004 use the 'test$(git ...) = ...' or the '! (git ...)'
subshell pattern. This swallows git's exit code. If git crashes
(e.g. segmentation fault) the crash would go undetected, and the test
would fail due to a mismatch or an inverted exit code.
Modernize these tests by directly writing output to files(actual) and
verifying them with 'test_cmp' or 'test_grep'. Replace subshell
negations with 'test_must_fail'. This way, if git crashes, the test
fails immediately and clearly instead of hiding the error behind a
string mismatch.
Signed-off-by: Siddharth Shrimali <r.siddharth.shrimali@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4013/diff.format-patch_--stdout_initial..main^')
0 files changed, 0 insertions, 0 deletions
