diff options
| author | Shlok Kulshreshtha <diy2903@gmail.com> | 2026-07-15 17:03:44 +0530 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-07-15 12:25:06 -0700 |
| commit | b6b276974e727f4ac92fbaef972f2cd59b3071dd (patch) | |
| tree | 5de5d75c26fd01f976db2744f4dbf0a990ed3129 /t/t4013/diff.diff_initial..side | |
| parent | 55526a18268bbc1ddaf8a6b7850c33d984eac9e9 (diff) | |
t7614: avoid hiding git's exit code in a pipe
The exit code of the upstream command in a pipe is ignored, so in
git cat-file commit HEAD | sed -e "1,/^\$/d" >actual
a crash of "git cat-file" would go unnoticed: the exit code of the
pipeline is that of "sed", which happily succeeds on empty input. The
test would thus pass even though "git cat-file" failed.
Write the output of "git cat-file" to a file first and run "sed" on
that file, so that the exit codes of both commands are checked by the
&&-chain.
Signed-off-by: Shlok Kulshreshtha <diy2903@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4013/diff.diff_initial..side')
0 files changed, 0 insertions, 0 deletions
