diff options
| author | Patrick Steinhardt <ps@pks.im> | 2024-04-17 08:16:31 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-04-17 08:42:26 -0700 |
| commit | b396ee6bed7882af3333eb52333f8a34b648437d (patch) | |
| tree | 800f4cb7cb9b676d7c6a1d9b65de17d3cce292d1 /run-command.h | |
| parent | Git 2.44 (diff) | |
| download | git-b396ee6bed7882af3333eb52333f8a34b648437d.tar.gz git-b396ee6bed7882af3333eb52333f8a34b648437d.zip | |
run-command: introduce function to prepare auto-maintenance process
The `run_auto_maintenance()` function is responsible for spawning a new
`git maintenance run --auto` process. To do so, it sets up the `sturct
child_process` and then runs it by executing `run_command()` directly.
This is rather inflexible in case callers want to modify the child
process somewhat, e.g. to redirect stderr or stdout.
Introduce a new `prepare_auto_maintenance()` function to plug this gap.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'run-command.h')
| -rw-r--r-- | run-command.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/run-command.h b/run-command.h index 1f22cc3827..55f6631a2a 100644 --- a/run-command.h +++ b/run-command.h @@ -218,6 +218,13 @@ int finish_command_in_signal(struct child_process *); int run_command(struct child_process *); /* + * Prepare a `struct child_process` to run auto-maintenance. Returns 1 if the + * process has been prepared and is ready to run, or 0 in case auto-maintenance + * should be skipped. + */ +int prepare_auto_maintenance(int quiet, struct child_process *maint); + +/* * Trigger an auto-gc */ int run_auto_maintenance(int quiet); |
