summaryrefslogtreecommitdiff
path: root/t/t0021-conversion.sh
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2021-03-03 15:14:46 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2021-03-03 15:14:46 +0900
commit3815afa233c3938e6f4b67d2f5551297f0c45509 (patch)
treedb02b3f661487173141a3f4ea84fa32b563007ea /t/t0021-conversion.sh
parenta6b062f9873fedceda595670180829e84325440e (diff)
downloadgit-3815afa233c3938e6f4b67d2f5551297f0c45509.tar.gz
git-3815afa233c3938e6f4b67d2f5551297f0c45509.tar.bz2
git-3815afa233c3938e6f4b67d2f5551297f0c45509.zip
Imported Upstream version 2.2.0upstream/2.2.0
Diffstat (limited to 't/t0021-conversion.sh')
-rwxr-xr-xt/t0021-conversion.sh24
1 files changed, 19 insertions, 5 deletions
diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh
index f890c54d..ca7d2a63 100755
--- a/t/t0021-conversion.sh
+++ b/t/t0021-conversion.sh
@@ -153,17 +153,23 @@ test_expect_success 'filter shell-escaped filenames' '
:
'
-test_expect_success 'required filter success' '
- git config filter.required.smudge cat &&
- git config filter.required.clean cat &&
+test_expect_success 'required filter should filter data' '
+ git config filter.required.smudge ./rot13.sh &&
+ git config filter.required.clean ./rot13.sh &&
git config filter.required.required true &&
echo "*.r filter=required" >.gitattributes &&
- echo test >test.r &&
+ cat test.o >test.r &&
git add test.r &&
+
rm -f test.r &&
- git checkout -- test.r
+ git checkout -- test.r &&
+ cmp test.o test.r &&
+
+ ./rot13.sh <test.o >expected &&
+ git cat-file blob :test.r >actual &&
+ cmp expected actual
'
test_expect_success 'required filter smudge failure' '
@@ -190,6 +196,14 @@ test_expect_success 'required filter clean failure' '
test_must_fail git add test.fc
'
+test_expect_success 'filtering large input to small output should use little memory' '
+ git config filter.devnull.clean "cat >/dev/null" &&
+ git config filter.devnull.required true &&
+ for i in $(test_seq 1 30); do printf "%1048576d" 1; done >30MB &&
+ echo "30MB filter=devnull" >.gitattributes &&
+ GIT_MMAP_LIMIT=1m GIT_ALLOC_LIMIT=1m git add 30MB
+'
+
test_expect_success EXPENSIVE 'filter large file' '
git config filter.largefile.smudge cat &&
git config filter.largefile.clean cat &&