summaryrefslogtreecommitdiff
path: root/builtin/fetch.c
diff options
context:
space:
mode:
authorLibravatar Johannes Schindelin <johannes.schindelin@gmx.de>2021-09-09 09:47:07 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-09-09 12:56:11 -0700
commit5a22a334cb757753230f1d73da36130513016830 (patch)
tree5758d7c7ba361efa6d23640839309bf88bba3286 /builtin/fetch.c
parentrun-command: offer to close the object store before running (diff)
downloadtgif-5a22a334cb757753230f1d73da36130513016830.tar.xz
run_auto_maintenance(): implicitly close the object store
Before spawning the auto maintenance, we need to make sure that we release all open file handles to all the `.pack` files (and MIDX files and commit-graph files and...) so that the maintenance process has the freedom to delete those files. So far, we did this manually every time before calling `run_auto_maintenance()`. With the new `close_object_store` flag, we can do that implicitly in that function, which is more robust because future callers won't be able to forget to close the object store. Note: this changes behavior slightly, as we previously _always_ closed the object store, but now we only close the object store when actually running the auto maintenance. In practice, this should not matter (if anything, it might speed up operations where auto maintenance is disabled). Suggested-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/fetch.c')
-rw-r--r--builtin/fetch.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c
index 25740c13df..c9ac8664e1 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -2133,8 +2133,6 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
NULL);
}
- close_object_store(the_repository->objects);
-
if (enable_auto_gc)
run_auto_maintenance(verbosity < 0);