diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-05-22 12:41:57 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-05-22 12:41:57 -0700 |
commit | ddaf4e2e9a8b38185405205ddead638cf052728e (patch) | |
tree | 67c406d62df91a583c2a7a34af92c1317e6b966f /t | |
parent | 5bf66689d5a4ddc4ce7b3b88a15f6bcf6a0c13fa (diff) | |
parent | 0c4dd67a048b39470b9b95912e4912fecc405a85 (diff) | |
download | git-ddaf4e2e9a8b38185405205ddead638cf052728e.tar.gz |
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-x | t/t0021-conversion.sh | 10 |
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 && |