summaryrefslogtreecommitdiffstats
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-04-24 00:05:56 +0200
committerJunio C Hamano <gitster@pobox.com>2024-04-24 00:05:56 +0200
commit5c7ffafcea5fe37d435cc684d59eee91696dfb9f (patch)
tree92cf92dfae892cb60d6fc974cda2b11a01b5fc3e /builtin
parentMerge branch 'pk/bisect-use-show' (diff)
parentbuiltin/receive-pack: convert to use git-maintenance(1) (diff)
downloadgit-5c7ffafcea5fe37d435cc684d59eee91696dfb9f.tar.xz
git-5c7ffafcea5fe37d435cc684d59eee91696dfb9f.zip
Merge branch 'ps/run-auto-maintenance-in-receive-pack'
The "receive-pack" program (which responds to "git push") was not converted to run "git maintenance --auto" when other codepaths that used to run "git gc --auto" were updated, which has been corrected. * ps/run-auto-maintenance-in-receive-pack: builtin/receive-pack: convert to use git-maintenance(1) run-command: introduce function to prepare auto-maintenance process
Diffstat (limited to 'builtin')
-rw-r--r--builtin/receive-pack.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index 56d8a77ed7..e8d7df14b6 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -2585,17 +2585,16 @@ int cmd_receive_pack(int argc, const char **argv, const char *prefix)
if (auto_gc) {
struct child_process proc = CHILD_PROCESS_INIT;
- proc.no_stdin = 1;
- proc.stdout_to_stderr = 1;
- proc.err = use_sideband ? -1 : 0;
- proc.git_cmd = proc.close_object_store = 1;
- strvec_pushl(&proc.args, "gc", "--auto", "--quiet",
- NULL);
-
- if (!start_command(&proc)) {
- if (use_sideband)
- copy_to_sideband(proc.err, -1, NULL);
- finish_command(&proc);
+ if (prepare_auto_maintenance(1, &proc)) {
+ proc.no_stdin = 1;
+ proc.stdout_to_stderr = 1;
+ proc.err = use_sideband ? -1 : 0;
+
+ if (!start_command(&proc)) {
+ if (use_sideband)
+ copy_to_sideband(proc.err, -1, NULL);
+ finish_command(&proc);
+ }
}
}
if (auto_update_server_info)