summaryrefslogtreecommitdiff
path: root/builtin/gc.c
diff options
context:
space:
mode:
authorKim Gybels <kgybels@infogroep.be>2018-07-09 20:37:27 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-07-09 21:16:10 (GMT)
commit12e73a3ce46135279cec8fc9ef0068948936e6f8 (patch)
tree0789c3cfa823c147f3f380486c3a570f3a002ce9 /builtin/gc.c
parent53f9a3e157dbbc901a02ac2c73346d375e24978c (diff)
downloadgit-12e73a3ce46135279cec8fc9ef0068948936e6f8.zip
git-12e73a3ce46135279cec8fc9ef0068948936e6f8.tar.gz
git-12e73a3ce46135279cec8fc9ef0068948936e6f8.tar.bz2
gc --auto: release pack files before auto packing
Teach gc --auto to release pack files before auto packing the repository to prevent failures when removing them. Also teach the test 'fetching with auto-gc does not lock up' to complain when it is no longer triggering an auto packing of the repository. Fixes https://github.com/git-for-windows/git/issues/500 Signed-off-by: Kim Gybels <kgybels@infogroep.be> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/gc.c')
-rw-r--r--builtin/gc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin/gc.c b/builtin/gc.c
index ccfb1ce..63b62ab 100644
--- a/builtin/gc.c
+++ b/builtin/gc.c
@@ -612,6 +612,7 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
return -1;
if (!repository_format_precious_objects) {
+ close_all_packs(the_repository->objects);
if (run_command_v_opt(repack.argv, RUN_GIT_CMD))
return error(FAILED_RUN, repack.argv[0]);