summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--builtin/gc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/gc.c b/builtin/gc.c
index bcef6a4c8d..900ccfb8d4 100644
--- a/builtin/gc.c
+++ b/builtin/gc.c
@@ -611,9 +611,10 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
}
if (detach_auto) {
int ret = report_last_gc_error();
+
if (ret < 0)
/* an I/O error occurred, already reported */
- exit(128);
+ return 128;
if (ret == 1)
/* Last gc --auto failed. Skip this one. */
return 0;