From 52b4f704fd0d3f1ced8419cbcb460dd8374d8220 Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Tue, 7 Aug 2007 22:26:45 +0200 Subject: [PATCH] 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. --- git.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git.c b/git.c index fd604b51fc..adbc188d86 100644 --- a/git.c +++ b/git.c @@ -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))