]> git.ipfire.org Git - thirdparty/git.git/commitdiff
builtin run_command: do not exit with -1.
authorJohannes Sixt <johannes.sixt@telecom.at>
Tue, 13 Nov 2007 20:05:02 +0000 (21:05 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 14 Nov 2007 23:18:39 +0000 (15:18 -0800)
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>
git.c

diff --git a/git.c b/git.c
index 4a250f7e8b84f2334c84daaf93baa0fe1f0ca344..37d99d6f50dac4052616f337904807c76b17d01e 100644 (file)
--- 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))