summaryrefslogtreecommitdiff
path: root/t/t3701-add-interactive.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-09-13 19:21:08 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-09-13 19:21:08 (GMT)
commitaa31cb89743a9ba4efd43f5160bfea0a4cbe5858 (patch)
tree0c70668c1d69a88696f9e40c5bc4d90617170286 /t/t3701-add-interactive.sh
parent72869e750bf62fa313e7854d18e48c083f4720cc (diff)
parent716c1f649e372a0784b9826cd3839e7b373e2ea9 (diff)
downloadgit-aa31cb89743a9ba4efd43f5160bfea0a4cbe5858.zip
git-aa31cb89743a9ba4efd43f5160bfea0a4cbe5858.tar.gz
git-aa31cb89743a9ba4efd43f5160bfea0a4cbe5858.tar.bz2
Merge branch 'jk/pipe-command-nonblock' into maint
Fix deadlocks between main Git process and subprocess spawned via the pipe_command() API, that can kill "git add -p" that was reimplemented in C recently. * jk/pipe-command-nonblock: pipe_command(): mark stdin descriptor as non-blocking pipe_command(): handle ENOSPC when writing to a pipe pipe_command(): avoid xwrite() for writing to pipe git-compat-util: make MAX_IO_SIZE define globally available nonblock: support Windows compat: add function to enable nonblocking pipes
Diffstat (limited to 't/t3701-add-interactive.sh')
-rwxr-xr-xt/t3701-add-interactive.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/t/t3701-add-interactive.sh b/t/t3701-add-interactive.sh
index b354fb3..3b7df9b 100755
--- a/t/t3701-add-interactive.sh
+++ b/t/t3701-add-interactive.sh
@@ -766,6 +766,19 @@ test_expect_success 'detect bogus diffFilter output' '
force_color test_must_fail git add -p <y
'
+test_expect_success 'handle very large filtered diff' '
+ git reset --hard &&
+ # The specific number here is not important, but it must
+ # be large enough that the output of "git diff --color"
+ # fills up the pipe buffer. 10,000 results in ~200k of
+ # colored output.
+ test_seq 10000 >test &&
+ test_config interactive.diffFilter cat &&
+ printf y >y &&
+ force_color git add -p >output 2>&1 <y &&
+ git diff-files --exit-code -- test
+'
+
test_expect_success 'diff.algorithm is passed to `git diff-files`' '
git reset --hard &&