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 <johannes.sixt@telecom.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Sixt committed
Nov 13, 2007 at 21:05 UTC
2488df84a28b5eaae5495a59e390b51874d60a03
1 file changed
+1
-1
git.c
+1
-1
@@ -256,7 +256,7 @@ static int run_command(struct cmd_struct *p, int argc, const char **argv)
256
257
status = p->fn(argc, argv, prefix);
258
if (status)
259
- return status;
259
+ return status & 0xff;
260
261
/* Somebody closed stdout? */
262
if (fstat(fileno(stdout), &st))