]> git.ipfire.org Git - thirdparty/git.git/blob - t/t4141-apply-too-large.sh
Merge branch 'jc/bisect-doc' into maint-2.43
[thirdparty/git.git] / t / t4141-apply-too-large.sh
1 #!/bin/sh
2
3 test_description='git apply with too-large patch'
4
5 TEST_PASSES_SANITIZE_LEAK=true
6 . ./test-lib.sh
7
8 test_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 &&
20 grep "patch too large" err
21 '
22
23 test_done