mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
sha1_file.c: move delayed getenv(altdb) back to setup_git_env()
getenv() is supposed to work on the main repository only. This delayed getenv() code in sha1_file.c makes it more difficult to convert sha1_file.c to a generic object store that could be used by both submodule and main repositories. Move the getenv() back in setup_git_env() where other env vars are also fetched. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
0ac5af5995
commit
7bc0dcaa61
@@ -174,6 +174,7 @@ void setup_git_env(const char *git_dir)
|
||||
args.object_dir = getenv_safe(&to_free, DB_ENVIRONMENT);
|
||||
args.graft_file = getenv_safe(&to_free, GRAFT_ENVIRONMENT);
|
||||
args.index_file = getenv_safe(&to_free, INDEX_ENVIRONMENT);
|
||||
args.alternate_db = getenv_safe(&to_free, ALTERNATE_DB_ENVIRONMENT);
|
||||
repo_set_gitdir(the_repository, git_dir, &args);
|
||||
argv_array_clear(&to_free);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user