From: Junio C Hamano Date: Tue, 9 Jul 2019 22:25:42 +0000 (-0700) Subject: Merge branch 'nd/fetch-multi-gc-once' X-Git-Tag: v2.23.0-rc0~69 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/892d3fb71e75849811c038b9fcaf17188a9ccf5d Merge branch 'nd/fetch-multi-gc-once' "git fetch" that grabs from a group of remotes learned to run the auto-gc only once at the very end. * nd/fetch-multi-gc-once: fetch: only run 'gc' once when fetching multiple remotes --- 892d3fb71e75849811c038b9fcaf17188a9ccf5d diff --cc builtin/fetch.c index c9b92b1e52,6a3c507897..667f2cec7b --- a/builtin/fetch.c +++ b/builtin/fetch.c @@@ -1680,13 -1675,15 +1683,15 @@@ int cmd_fetch(int argc, const char **ar string_list_clear(&list, 0); - close_all_packs(the_repository->objects); + close_object_store(the_repository->objects); - argv_array_pushl(&argv_gc_auto, "gc", "--auto", NULL); - if (verbosity < 0) - argv_array_push(&argv_gc_auto, "--quiet"); - run_command_v_opt(argv_gc_auto.argv, RUN_GIT_CMD); - argv_array_clear(&argv_gc_auto); + if (enable_auto_gc) { + argv_array_pushl(&argv_gc_auto, "gc", "--auto", NULL); + if (verbosity < 0) + argv_array_push(&argv_gc_auto, "--quiet"); + run_command_v_opt(argv_gc_auto.argv, RUN_GIT_CMD); + argv_array_clear(&argv_gc_auto); + } return result; }