Skip to content

Commit 0748f3a

Browse files
dschoGit for Windows Build Agent
authored andcommitted
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 5952128 commit 0748f3a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

builtin/pull.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,6 +1045,7 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
10451045
oidclr(&rebase_fork_point);
10461046
}
10471047

1048+
close_object_store(the_repository->objects);
10481049
if (run_fetch(repo, refspecs))
10491050
return 1;
10501051

0 commit comments

Comments
 (0)