]> git.ipfire.org Git - thirdparty/git.git/commit
auto-gc: extract a reusable helper from "git fetch"
authorJunio C Hamano <gitster@pobox.com>
Wed, 6 May 2020 20:18:29 +0000 (13:18 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 7 May 2020 19:24:33 +0000 (12:24 -0700)
commit850b6edefa7a4fcc75149447cb8a984f804dd080
tree247e4bb6b77b2517b67b771736a13303de3ef1a9
parentaf6b65d45ef179ed52087e80cb089f6b2349f4ec
auto-gc: extract a reusable helper from "git fetch"

Back in 1991006c (fetch: convert argv_gc_auto to struct argv_array,
2014-08-16), we taught "git fetch --quiet" to pass the "--quiet"
option down to "gc --auto".  This issue, however, is not limited to
"fetch":

    $ git grep -e 'gc.*--auto' \*.c

finds hits in "am", "commit", "merge", and "rebase" and these
commands do not pass "--quiet" down to "gc --auto" when they
themselves are told to be quiet.

As a preparatory step, let's introduce a helper function
run_auto_gc(), that the caller can pass a boolean "quiet",
and redo the fix to "git fetch" using the helper.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Reviewed-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fetch.c
run-command.c
run-command.h