diff options
| author | Siddharth Shrimali <r.siddharth.shrimali@gmail.com> | 2026-04-21 11:03:34 +0530 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-04-21 00:20:42 -0700 |
| commit | ef85286e511b4cebfdce0c4bffc7c8985274f142 (patch) | |
| tree | 150a6863739842d43862a190a0663707c7763d76 /git-remote-testgit | |
| parent | e3253255d3e1c007e80742c304ddde9421dca9ca (diff) | |
| download | git-ef85286e511b4cebfdce0c4bffc7c8985274f142.tar.gz git-ef85286e511b4cebfdce0c4bffc7c8985274f142.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 'git-remote-testgit')
0 files changed, 0 insertions, 0 deletions
