Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorPhillip Wood <phillip.wood@dunelm.org.uk>2023-06-26 12:37:33 +0300
committerJunio C Hamano <gitster@pobox.com>2023-06-26 18:58:50 +0300
commit42612e18d2e7c002054b677df791b848b62c1628 (patch)
tree693ec646bf7b165b856f7f1e2552d82f8212d40e /t
parent9bbde12feed306b9044060e4eab6b3b4c6628050 (diff)
apply: improve error messages when reading patch
Commit f1c0e3946e (apply: reject patches larger than ~1 GiB, 2022-10-25) added a limit on the size of patch that apply will process to avoid integer overflows. The implementation re-used the existing error message for when we are unable to read the patch. This is unfortunate because (a) it does not signal to the user that the patch is being rejected because it is too large and (b) it uses error_errno() without setting errno. This patch adds a specific error message for the case when a patch is too large. It also updates the existing message to make it clearer that it is the patch that cannot be read rather than any other file and marks both messages for translation. The "git apply" prefix is also dropped to match most of the rest of the error messages in apply.c (there are still a few error messages that prefixed with "git apply" and are not marked for translation after this patch). The test added in f1c0e3946e is updated accordingly. Reported-by: Premek Vysoky <Premek.Vysoky@microsoft.com> Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t4141-apply-too-large.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t4141-apply-too-large.sh b/t/t4141-apply-too-large.sh
index 58742d4fc5..20cc1209f6 100755
--- a/t/t4141-apply-too-large.sh
+++ b/t/t4141-apply-too-large.sh
@@ -17,7 +17,7 @@ test_expect_success EXPENSIVE 'git apply rejects patches that are too large' '
EOF
test-tool genzeros
} | test_copy_bytes $sz | test_must_fail git apply 2>err &&
- grep "git apply: failed to read" err
+ grep "patch too large" err
'
test_done