Skip to content

Commit 0e956ae

Browse files
committed
pull: release packs before fetching
On Windows, files cannot be removed nor renamed if there are still handles held by a process. To remedy that, we try to release all open handles to any `.pack` file before e.g. repacking (which would want to remove the original `.pack` file(s) after it is done). Since the `read_cache_unmerged()` and/or the `get_oid()` call in `git pull` can cause `.pack` files to be opened, we need to release the open handles before calling `git fetch`: the latter process might want to spawn an auto-gc, which in turn might want to repack the objects. This commit is similar in spirit to 5bdece0 (gc/repack: release packs when needed, 2018-12-15). This fixes #3336. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent aade3ca commit 0e956ae

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

builtin/pull.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "wt-status.h"
2727
#include "commit-reach.h"
2828
#include "sequencer.h"
29+
#include "packfile.h"
2930

3031
/**
3132
* Parses the value of --rebase. If value is a false value, returns
@@ -998,6 +999,7 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
998999
oidclr(&rebase_fork_point);
9991000
}
10001001

1002+
close_object_store(the_repository->objects);
10011003
if (run_fetch(repo, refspecs))
10021004
return 1;
10031005

0 commit comments

Comments
 (0)