From c024beb56da679839d61f352d088b9a86823233a Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Sat, 4 Jul 2009 21:26:42 +0200 Subject: run_command: report failure to execute the program, but optionally don't In the case where a program was not found, it was still the task of the caller to report an error to the user. Usually, this is an interesting case but only few callers actually reported a specific error (though many call sites report a generic error message regardless of the cause). With this change the error is reported by run_command, but since there is one call site in git.c that does not want that, an option is added to struct child_process, which is used to turn the error off. Signed-off-by: Johannes Sixt Signed-off-by: Junio C Hamano --- builtin-receive-pack.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'builtin-receive-pack.c') diff --git a/builtin-receive-pack.c b/builtin-receive-pack.c index 1dcdb1a514..c85507b122 100644 --- a/builtin-receive-pack.c +++ b/builtin-receive-pack.c @@ -125,9 +125,7 @@ static const char post_receive_hook[] = "hooks/post-receive"; static int run_status(int code, const char *cmd_name) { - if (code < 0 && errno == ENOENT) - return error("execute of %s failed", cmd_name); - else if (code > 0) + if (code > 0) error("%s exited with error code %d", cmd_name, code); return code; } -- cgit v1.2.3