Skip to content

Commit

Permalink
builtin run_command: do not exit with -1.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johannes Sixt authored and Junio C Hamano committed Nov 14, 2007
1 parent 80bbe72 commit 2488df8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion git.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 2488df8

Please sign in to comment.