From: Johannes Sixt Date: Tue, 13 Nov 2007 20:05:02 +0000 (+0100) Subject: builtin run_command: do not exit with -1. X-Git-Tag: v1.5.4-rc0~154^2~6 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=2488df84a28b5eaae5495a59e390b51874d60a03;p=git.git builtin run_command: do not exit with -1. There are shells that do not correctly detect an exit code of -1 as a failure. We simply truncate the status code to the lower 8 bits. Signed-off-by: Johannes Sixt Signed-off-by: Junio C Hamano --- diff --git a/git.c b/git.c index 4a250f7e8..37d99d6f5 100644 --- a/git.c +++ b/git.c @@ -256,7 +256,7 @@ static int run_command(struct cmd_struct *p, int argc, const char **argv) status = p->fn(argc, argv, prefix); if (status) - return status; + return status & 0xff; /* Somebody closed stdout? */ if (fstat(fileno(stdout), &st))