]> git.ipfire.org Git - thirdparty/git.git/commit
run-command: report exec error even on ENOENT
authorRené Scharfe <l.s.r@web.de>
Sat, 10 Jun 2023 14:51:21 +0000 (16:51 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 12 Jun 2023 18:00:22 +0000 (11:00 -0700)
commit6d224ac286d62bb3a10c3697f220b0c10d4b5f51
tree9b07f8b0802bc9bb87ec5ef3e30f983b13081b23
parent6b6fe8b43ee71e52141ad762a38339688278f66f
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>
run-command.c
t/t1800-hook.sh