]> git.ipfire.org Git - thirdparty/git.git/blame - t/t4141-apply-too-large.sh
The third batch
[thirdparty/git.git] / t / t4141-apply-too-large.sh
CommitLineData
f1c0e394
TB
1#!/bin/sh
2
3test_description='git apply with too-large patch'
4
5TEST_PASSES_SANITIZE_LEAK=true
6. ./test-lib.sh
7
8test_expect_success EXPENSIVE 'git apply rejects patches that are too large' '
9 sz=$((1024 * 1024 * 1023)) &&
10 {
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 &&
42612e18 20 grep "patch too large" err
f1c0e394
TB
21'
22
23test_done