summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2015-05-22 12:41:57 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2015-05-22 12:41:57 -0700
commitddaf4e2e9a8b38185405205ddead638cf052728e (patch)
tree67c406d62df91a583c2a7a34af92c1317e6b966f /t
parentMerge branch 'mh/clone-verbosity-fix' (diff)
parentfilter_buffer_or_fd(): ignore EPIPE (diff)
downloadtgif-ddaf4e2e9a8b38185405205ddead638cf052728e.tar.xz
Merge branch 'jc/ignore-epipe-in-filter'
Filter scripts were run with SIGPIPE disabled on the Git side, expecting that they may not read what Git feeds them to filter. We however treated a filter that does not read its input fully before exiting as an error. This changes semantics, but arguably in a good way. If a filter can produce its output without consuming its input using whatever magic, we now let it do so, instead of diagnosing it as a programming error. * jc/ignore-epipe-in-filter: filter_buffer_or_fd(): ignore EPIPE copy.c: make copy_fd() report its status silently
Diffstat (limited to 't')
-rwxr-xr-xt/t0021-conversion.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh
index ca7d2a630a..e0200b9f33 100755
--- a/t/t0021-conversion.sh
+++ b/t/t0021-conversion.sh
@@ -204,6 +204,16 @@ test_expect_success 'filtering large input to small output should use little mem
GIT_MMAP_LIMIT=1m GIT_ALLOC_LIMIT=1m git add 30MB
'
+test_expect_success 'filter that does not read is fine' '
+ test-genrandom foo $((128 * 1024 + 1)) >big &&
+ echo "big filter=epipe" >.gitattributes &&
+ git config filter.epipe.clean "echo xyzzy" &&
+ git add big &&
+ git cat-file blob :big >actual &&
+ echo xyzzy >expect &&
+ test_cmp expect actual
+'
+
test_expect_success EXPENSIVE 'filter large file' '
git config filter.largefile.smudge cat &&
git config filter.largefile.clean cat &&