summaryrefslogtreecommitdiffstats
path: root/environment.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-09-12 13:29:27 +0200
committerJunio C Hamano <gitster@pobox.com>2024-09-12 19:15:39 +0200
commit661624a4f6299b44f56df162100fdca528c119c1 (patch)
treeb210fa7d6fc0c5fc1e63bea4b5dac9ebba48e8d7 /environment.c
parentenvironment: make `get_git_dir()` accept a repository (diff)
downloadgit-661624a4f6299b44f56df162100fdca528c119c1.tar.xz
git-661624a4f6299b44f56df162100fdca528c119c1.zip
environment: make `get_git_common_dir()` accept a repository
The `get_git_common_dir()` function retrieves the path to the common directory for `the_repository`. Make it accept a `struct repository` such that it can work on arbitrary repositories and make it part of the repository subsystem. This reduces our reliance on `the_repository` and clarifies scope. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'environment.c')
-rw-r--r--environment.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/environment.c b/environment.c
index 040b1ff1ba..7c4a142ca2 100644
--- a/environment.c
+++ b/environment.c
@@ -228,13 +228,6 @@ int have_git_dir(void)
|| the_repository->gitdir;
}
-const char *get_git_common_dir(void)
-{
- if (!the_repository->commondir)
- BUG("git environment hasn't been setup");
- return the_repository->commondir;
-}
-
const char *get_git_namespace(void)
{
if (!git_namespace)