summaryrefslogtreecommitdiff
path: root/builtin/gc.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/gc.c')
-rw-r--r--builtin/gc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/builtin/gc.c b/builtin/gc.c
index 91f7696a85..2d2027d8b0 100644
--- a/builtin/gc.c
+++ b/builtin/gc.c
@@ -413,8 +413,12 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
if (report_last_gc_error())
return -1;
+ if (lock_repo_for_gc(force, &pid))
+ return 0;
if (gc_before_repack())
return -1;
+ delete_tempfile(&pidfile);
+
/*
* failure to daemonize is ok, we'll continue
* in foreground