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:
authorGlen Choo <chooglen@google.com>2023-06-14 22:35:58 +0300
committerJunio C Hamano <gitster@pobox.com>2023-06-16 18:35:06 +0300
commit69f4da8eadac4213fddbf68d85c992f230287001 (patch)
treef91abc9c35065a021a65dd2526e23eeb001edac2 /setup.c
parentd7d8841f67f29e6ecbad85a11805c907d0f00d5d (diff)
setup.c: don't setup in discover_git_directory()
discover_git_directory() started modifying the_repository in ebaf3bcf1ae (repository: move global r_f_p_c to repo struct, 2021-06-17), when, in the repository setup process, we started copying members from the "struct repository_format" we're inspecting to the appropriate "struct repository". However, discover_git_directory() isn't actually used in the setup process (its only caller in the Git binary is read_early_config()), so it shouldn't be doing this setup at all! As explained by 16ac8b8db6 (setup: introduce the discover_git_directory() function, 2017-03-13) and the comment on its declaration, discover_git_directory() is intended to be an entrypoint into setup.c machinery that allows the Git directory to be discovered without side effects, e.g. so that read_early_config() can read ".git/config" before the_repository has been set up. Fortunately, we didn't start to rely on this unintended behavior between then and now, so we let's just remove it. It isn't harming anyone, but it's confusing. Signed-off-by: Glen Choo <chooglen@google.com> Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'setup.c')
-rw-r--r--setup.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/setup.c b/setup.c
index 458582207e..bbd95f52c0 100644
--- a/setup.c
+++ b/setup.c
@@ -1423,11 +1423,6 @@ int discover_git_directory(struct strbuf *commondir,
return -1;
}
- /* take ownership of candidate.partial_clone */
- the_repository->repository_format_partial_clone =
- candidate.partial_clone;
- candidate.partial_clone = NULL;
-
clear_repository_format(&candidate);
return 0;
}