Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compat/mingw.h2
-rw-r--r--git.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/compat/mingw.h b/compat/mingw.h
index 4f7ba4c13f..c1859c5480 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -92,6 +92,8 @@ static inline int fcntl(int fd, int cmd, long arg)
errno = EINVAL;
return -1;
}
+/* bash cannot reliably detect negative return codes as failure */
+#define exit(code) exit((code) & 0xff)
/*
* simple adaptors
diff --git a/git.c b/git.c
index 9acce91850..807d875ae0 100644
--- a/git.c
+++ b/git.c
@@ -245,7 +245,7 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv)
status = p->fn(argc, argv, prefix);
if (status)
- return status & 0xff;
+ return status;
/* Somebody closed stdout? */
if (fstat(fileno(stdout), &st))