Merge branch 'bc/clone-empty-repo-via-protocol-v0'
[alt-git.git] / t / t4141-apply-too-large.sh
blob58742d4fc5d5208808004cc17eb566abbf385461
1 #!/bin/sh
3 test_description='git apply with too-large patch'
5 TEST_PASSES_SANITIZE_LEAK=true
6 . ./test-lib.sh
8 test_expect_success EXPENSIVE 'git apply rejects patches that are too large' '
9 sz=$((1024 * 1024 * 1023)) &&
11 cat <<-\EOF &&
12 diff --git a/file b/file
13 new file mode 100644
14 --- /dev/null
15 +++ b/file
16 @@ -0,0 +1 @@
17 EOF
18 test-tool genzeros
19 } | test_copy_bytes $sz | test_must_fail git apply 2>err &&
20 grep "git apply: failed to read" err
23 test_done