builtin run_command: do not exit with -1.

The shell does not correctly detect an exit code of -1 as a failure.
We simply truncate the status code to the lower 8 bits.
This commit is contained in:
Johannes Sixt
2007-08-07 22:26:45 +02:00
parent 1c32cf28d7
commit 52b4f704fd

2
git.c
View File

@@ -288,7 +288,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))