receive-pack: release pack files before garbage-collecting

Before auto-gc'ing, we need to make sure that the pack files are released in case they need to be repacked and garbage-collected. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Schindelin committed Jan 13, 2016 at 18:20 UTC d5621020c1e0edfa998cb5c5e80cdf47f36ffb1a
1 file changed +1
builtin/receive-pack.c
+1
@@ -1796,6 +1796,7 @@ int cmd_receive_pack(int argc, const char **argv, const char *prefix)
1796 "gc", "--auto", "--quiet", NULL,
1797 };
1798 int opt = RUN_GIT_CMD | RUN_COMMAND_STDOUT_TO_STDERR;
1799 + close_all_packs();
1800 run_command_v_opt(argv_gc_auto, opt);
1801 }
1802 if (auto_update_server_info)