Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2021-09-09 12:47:08 +0300
committerJunio C Hamano <gitster@pobox.com>2021-09-09 22:56:11 +0300
commitc4dee2c0851f3a6b202afd2c9d979ed417f4bcdc (patch)
tree26bb6f2a86a488dbd3e3c46ca7a34b449e5bc3f5 /builtin/pull.c
parent5a22a334cb757753230f1d73da36130513016830 (diff)
Close object store closer to spawning child processes
In many cases where we spawned child processes that _may_ trigger a repack, we explicitly closed the object store first (so that the `repack` process can delete the `.pack` files, which would otherwise not be possible on Windows since files cannot be deleted as long as they as still in use). Wherever possible, we now use the new `close_object_store` bit of the `run_command()` API, to delay closing the object store even further. This makes the code easier to maintain because it is now more obvious that we only release those file handles because of those child processes. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/pull.c')
-rw-r--r--builtin/pull.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/builtin/pull.c b/builtin/pull.c
index d9f0156d96..751372041c 100644
--- a/builtin/pull.c
+++ b/builtin/pull.c
@@ -578,7 +578,7 @@ static int run_fetch(const char *repo, const char **refspecs)
strvec_pushv(&args, refspecs);
} else if (*refspecs)
BUG("refspecs without repo?");
- ret = run_command_v_opt(args.v, RUN_GIT_CMD);
+ ret = run_command_v_opt(args.v, RUN_GIT_CMD | RUN_CLOSE_OBJECT_STORE);
strvec_clear(&args);
return ret;
}
@@ -999,7 +999,6 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
oidclr(&rebase_fork_point);
}
- close_object_store(the_repository->objects);
if (run_fetch(repo, refspecs))
return 1;