summaryrefslogtreecommitdiff
path: root/run-command.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-11-18 21:32:53 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-11-18 21:32:53 (GMT)
commit7660da161821ab79b8ecd5019c28843ed7e770a6 (patch)
treed0993b4af829e0275d6ff7cd0f87b17f69819b7c /run-command.c
parentc042c455d4ffb9b5ed0c280301b5661f3efad572 (diff)
parent0016b618182f642771dc589cf0090289f9fe1b4f (diff)
downloadgit-7660da161821ab79b8ecd5019c28843ed7e770a6.zip
git-7660da161821ab79b8ecd5019c28843ed7e770a6.tar.gz
git-7660da161821ab79b8ecd5019c28843ed7e770a6.tar.bz2
Merge branch 'ds/maintenance-part-3'
Parts of "git maintenance" to ease writing crontab entries (and other scheduling system configuration) for it. * ds/maintenance-part-3: maintenance: add troubleshooting guide to docs maintenance: use 'incremental' strategy by default maintenance: create maintenance.strategy config maintenance: add start/stop subcommands maintenance: add [un]register subcommands for-each-repo: run subcommands on configured repos maintenance: add --schedule option and config maintenance: optionally skip --auto process
Diffstat (limited to 'run-command.c')
-rw-r--r--run-command.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/run-command.c b/run-command.c
index 2ee59ac..ea4d0fb 100644
--- a/run-command.c
+++ b/run-command.c
@@ -7,6 +7,7 @@
#include "strbuf.h"
#include "string-list.h"
#include "quote.h"
+#include "config.h"
void child_process_init(struct child_process *child)
{
@@ -1868,8 +1869,13 @@ int run_processes_parallel_tr2(int n, get_next_task_fn get_next_task,
int run_auto_maintenance(int quiet)
{
+ int enabled;
struct child_process maint = CHILD_PROCESS_INIT;
+ if (!git_config_get_bool("maintenance.auto", &enabled) &&
+ !enabled)
+ return 0;
+
maint.git_cmd = 1;
strvec_pushl(&maint.args, "maintenance", "run", "--auto", NULL);
strvec_push(&maint.args, quiet ? "--quiet" : "--no-quiet");