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
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2023-06-10 17:51:21 +0300
committerJunio C Hamano <gitster@pobox.com>2023-06-12 21:00:22 +0300
commit6d224ac286d62bb3a10c3697f220b0c10d4b5f51 (patch)
tree9b07f8b0802bc9bb87ec5ef3e30f983b13081b23 /t/t1800-hook.sh
parent6b6fe8b43ee71e52141ad762a38339688278f66f (diff)
run-command: report exec error even on ENOENT
If execve(2) fails with ENOENT and we report the error, we use the format "cannot run %s", followed by the actual error message. For other errors we use "cannot exec '%s'". Stop making this subtle distinction and use the second format for all execve(2) errors. This simplifies the code and makes the prefix more precise by indicating the failed operation. It also allows us to slightly simplify t1800.16. On Windows -- which lacks execve(2) -- we already use a single format in all cases: "cannot spawn %s". Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1800-hook.sh')
-rwxr-xr-xt/t1800-hook.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t1800-hook.sh b/t/t1800-hook.sh
index c156d6decc..8b0234cf2d 100755
--- a/t/t1800-hook.sh
+++ b/t/t1800-hook.sh
@@ -164,7 +164,7 @@ test_expect_success 'git hook run a hook with a bad shebang' '
# TODO: We should emit the same (or at least a more similar)
# error on MINGW (essentially Git for Windows) and all other
# platforms.. See the OS-specific code in start_command()
- grep -E "^(error|fatal): cannot (exec|run|spawn) .*bad-hooks/test-hook" err
+ grep -E "^(error|fatal): cannot (exec|spawn) .*bad-hooks/test-hook" err
'
test_expect_success 'stdin to hooks' '