]> git.ipfire.org Git - thirdparty/git.git/commit
t3701: avoid depending on the TTY prerequisite
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Fri, 6 Dec 2019 13:08:20 +0000 (13:08 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 6 Dec 2019 16:57:33 +0000 (08:57 -0800)
commit8539b465341cc475f219ed46273a1c157bddafa0
treeac0e3f8ff2f93a67dcef119d610776a4114430d8
parent0f0fba2cc87219bf0c182201b7798ceb74c24857
t3701: avoid depending on the TTY prerequisite

The TTY prerequisite is a rather heavy one: it not only requires Perl to
work, but also the IO/Pty.pm module (with native support, and it
requires pseudo terminals, too).

In particular, test cases marked with the TTY prerequisite would be
skipped in Git for Windows' SDK.

In the case of `git add -p`, we do not actually need that big a hammer,
as we do not want to test any functionality that requires a pseudo
terminal; all we want is for the interactive add command to use color,
even when being called from within the test suite.

And we found exactly such a trick earlier already: when we added a test
case to verify that the main loop of `git add -i` is colored
appropriately. Let's use that trick instead of the TTY prerequisite.

While at it, we avoid the pipes, as we do not want a SIGPIPE to break
the regression test cases (which will be much more likely when we do not
run everything through Perl because that is inherently slower).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t3701-add-interactive.sh