pager: test for exit code with and without SIGPIPE
commitc24b7f67364fc89575926c7c79118df55b6103ef
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Tue, 2 Feb 2021 01:59:58 +0000 (2 02:59 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 2 Feb 2021 05:15:58 +0000 (1 21:15 -0800)
tree2ceec0de92e3aea52b7e344f8cf76b4963f95d61
parent61ff12fa50b051141dd3b451d74dde76a87fece3
pager: test for exit code with and without SIGPIPE

Add tests for how git behaves when the pager itself exits with
non-zero, as well as for us exiting with 141 when we're killed with
SIGPIPE due to the pager not consuming its output.

There is some recent discussion[1] about these semantics, but aside
from what we want to do in the future, we should have a test for the
current behavior.

This test construct is stolen from 7559a1be8a0 (unblock and unignore
SIGPIPE, 2014-09-18). The reason not to make the test itself depend on
the MINGW prerequisite is to make a subsequent commit easier to read.

1. https://lore.kernel.org/git/87o8h4omqa.fsf@evledraar.gmail.com/

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7006-pager.sh