diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-05-13 21:19:19 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-05-13 21:19:19 +0200 |
commit | 3af459e48dd275665568f3a7a6d76d90c1843e6a (patch) | |
tree | 7c6dd38b823daf85193e2044a3f696ec9ad3c7fe /run-command.c | |
parent | Merge branch 'cb/credential-doc-fixes' (diff) | |
parent | auto-gc: pass --quiet down from am, commit, merge and rebase (diff) | |
download | git-3af459e48dd275665568f3a7a6d76d90c1843e6a.tar.xz git-3af459e48dd275665568f3a7a6d76d90c1843e6a.zip |
Merge branch 'jc/auto-gc-quiet'
Teach "am", "commit", "merge" and "rebase", when they are run with
the "--quiet" option, to pass "--quiet" down to "gc --auto".
* jc/auto-gc-quiet:
auto-gc: pass --quiet down from am, commit, merge and rebase
auto-gc: extract a reusable helper from "git fetch"
Diffstat (limited to 'run-command.c')
-rw-r--r-- | run-command.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/run-command.c b/run-command.c index 0f41af3b55..9b3a57d1e3 100644 --- a/run-command.c +++ b/run-command.c @@ -1864,3 +1864,16 @@ int run_processes_parallel_tr2(int n, get_next_task_fn get_next_task, return result; } + +int run_auto_gc(int quiet) +{ + struct argv_array argv_gc_auto = ARGV_ARRAY_INIT; + int status; + + argv_array_pushl(&argv_gc_auto, "gc", "--auto", NULL); + if (quiet) + argv_array_push(&argv_gc_auto, "--quiet"); + status = run_command_v_opt(argv_gc_auto.argv, RUN_GIT_CMD); + argv_array_clear(&argv_gc_auto); + return status; +} |