diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2021-02-02 03:00:00 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-02-01 21:15:58 -0800 |
commit | be8fc53e364211856cca7affa4472855f96f8fa9 (patch) | |
tree | 4229319ea2b3c7819e719dbb2a8fed3b27d632c8 /csum-file.h | |
parent | run-command: add braces for "if" block in wait_or_whine() (diff) | |
download | tgif-be8fc53e364211856cca7affa4472855f96f8fa9.tar.xz |
pager: properly log pager exit code when signalled
When git invokes a pager that exits with non-zero the common case is
that we'll already return the correct SIGPIPE failure from git itself,
but the exit code logged in trace2 has always been incorrectly
reported[1]. Fix that and log the correct exit code in the logs.
Since this gives us something to test outside of our recently-added
tests needing a !MINGW prerequisite, let's refactor the test to run on
MINGW and actually check for SIGPIPE outside of MINGW.
The wait_or_whine() is only called with a true "in_signal" from from
finish_command_in_signal(), which in turn is only used in pager.c.
The "in_signal && !WIFEXITED(status)" case is not covered by
tests. Let's log the default -1 in that case for good measure.
1. The incorrect logging of the exit code in was seemingly copy/pasted
into finish_command_in_signal() in ee4512ed481 (trace2: create new
combined trace facility, 2019-02-22)
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'csum-file.h')
0 files changed, 0 insertions, 0 deletions