summaryrefslogtreecommitdiff
path: root/builtin-receive-pack.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin-receive-pack.c')
-rw-r--r--builtin-receive-pack.c22
1 files changed, 3 insertions, 19 deletions
diff --git a/builtin-receive-pack.c b/builtin-receive-pack.c
index 6235903552..1dcdb1a514 100644
--- a/builtin-receive-pack.c
+++ b/builtin-receive-pack.c
@@ -125,27 +125,11 @@ static const char post_receive_hook[] = "hooks/post-receive";
static int run_status(int code, const char *cmd_name)
{
- switch (code) {
- case 0:
- return 0;
- case -ERR_RUN_COMMAND_FORK:
- return error("fork of %s failed", cmd_name);
- case -ERR_RUN_COMMAND_EXEC:
+ if (code < 0 && errno == ENOENT)
return error("execute of %s failed", cmd_name);
- case -ERR_RUN_COMMAND_PIPE:
- return error("pipe failed");
- case -ERR_RUN_COMMAND_WAITPID:
- return error("waitpid failed");
- case -ERR_RUN_COMMAND_WAITPID_WRONG_PID:
- return error("waitpid is confused");
- case -ERR_RUN_COMMAND_WAITPID_SIGNAL:
- return error("%s died of signal", cmd_name);
- case -ERR_RUN_COMMAND_WAITPID_NOEXIT:
- return error("%s died strangely", cmd_name);
- default:
+ else if (code > 0)
error("%s exited with error code %d", cmd_name, code);
- return code;
- }
+ return code;
}
static int run_receive_hook(const char *hook_name)