Skip to content

Commit 998e2d8

Browse files
committed
squash! t3701: avoid depending on 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 <[email protected]>
1 parent f01b2ad commit 998e2d8

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

t/t3701-add-interactive.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,8 @@ test_expect_success 'diffs can be colorized' '
524524
git reset --hard &&
525525
526526
echo content >test &&
527-
printf y | force_color git add -p >output 2>&1 &&
527+
printf y >y &&
528+
force_color git add -p >output 2>&1 <y &&
528529
529530
# We do not want to depend on the exact coloring scheme
530531
# git uses for diffs, so just check that we saw some kind of color.
@@ -536,7 +537,8 @@ test_expect_success 'diffFilter filters diff' '
536537
537538
echo content >test &&
538539
test_config interactive.diffFilter "sed s/^/foo:/" &&
539-
printf y | force_color git add -p >output 2>&1 &&
540+
printf y >y &&
541+
force_color git add -p >output 2>&1 <y &&
540542
541543
# avoid depending on the exact coloring or content of the prompts,
542544
# and just make sure we saw our diff prefixed
@@ -548,7 +550,8 @@ test_expect_success 'detect bogus diffFilter output' '
548550
549551
echo content >test &&
550552
test_config interactive.diffFilter "echo too-short" &&
551-
printf y | test_must_fail force_color git add -p
553+
printf y >y &&
554+
test_must_fail force_color git add -p <y
552555
'
553556

554557
test_expect_success 'diff.algorithm is passed to `git diff-files`' '

0 commit comments

Comments
 (0)