Merge branch 'fixes/2.45.1/2.41' into fixes/2.45.1/2.42
[alt-git.git] / t / t4141-apply-too-large.sh
blob20cc1209f6259c703fc3ed3e9c193be24b429a3f
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 "patch too large" err
23 test_done