aboutsummaryrefslogtreecommitdiff
path: root/repository.h
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-09-12 13:29:24 +0200
committerJunio C Hamano <gitster@pobox.com>2024-09-12 10:15:39 -0700
commit246deeac9517d6daba89bfcf6de6d290e39af585 (patch)
treed604806493140d8f3f9e26f705c749b4a0535311 /repository.h
parent17d4b10aea6bda2027047a0e3548a6f8ad667dde (diff)
downloadgit-246deeac9517d6daba89bfcf6de6d290e39af585.tar.xz
environment: make `get_git_dir()` accept a repository
The `get_git_dir()` function retrieves the path to the Git 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 'repository.h')
-rw-r--r--repository.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/repository.h b/repository.h
index af6ea0a62c..cf2172c0aa 100644
--- a/repository.h
+++ b/repository.h
@@ -206,6 +206,8 @@ struct repository {
extern struct repository *the_repository;
#endif
+const char *repo_get_git_dir(struct repository *repo);
+
/*
* Define a custom repository layout. Any field can be NULL, which
* will default back to the path according to the default layout.