Raw
1 #!/bin/sh
2
3 test_description='git apply with too-large patch'
4
5 . ./test-lib.sh
6
7 test_expect_success EXPENSIVE 'git apply rejects patches that are too large' '
8 {
9 cat <<-\EOF &&
10 diff --git a/file b/file
11 new file mode 100644
12 --- /dev/null
13 +++ b/file
14 @@ -0,0 +1 @@
15 EOF
16 test-tool genzeros $((1024 * 1024 * 1023))
17 } | test_must_fail git apply 2>err &&
18 test_grep "patch too large" err
19 '
20
21 test_done