mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
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>
This commit is contained in:
committed by
Junio C Hamano
parent
246deeac95
commit
661624a4f6
@@ -2462,7 +2462,7 @@ void absorb_git_dir_into_superproject(const char *path,
|
||||
} else {
|
||||
/* Is it already absorbed into the superprojects git dir? */
|
||||
char *real_sub_git_dir = real_pathdup(sub_git_dir, 1);
|
||||
char *real_common_git_dir = real_pathdup(get_git_common_dir(), 1);
|
||||
char *real_common_git_dir = real_pathdup(repo_get_common_dir(the_repository), 1);
|
||||
|
||||
if (!starts_with(real_sub_git_dir, real_common_git_dir))
|
||||
relocate_single_git_dir_into_superproject(path, super_prefix);
|
||||
|
||||
Reference in New Issue
Block a user