summaryrefslogtreecommitdiff
path: root/environment.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2018-03-03 11:35:57 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-03-05 19:14:03 (GMT)
commit7bc0dcaa6120efec8cf8caef8511c09d35dbcf09 (patch)
treea5aebaf563a84a28783059b5aae03caa4fafeece /environment.c
parent0ac5af59957cc46641a6083207c9a04c1a9fa9c8 (diff)
downloadgit-7bc0dcaa6120efec8cf8caef8511c09d35dbcf09.zip
git-7bc0dcaa6120efec8cf8caef8511c09d35dbcf09.tar.gz
git-7bc0dcaa6120efec8cf8caef8511c09d35dbcf09.tar.bz2
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>
Diffstat (limited to 'environment.c')
-rw-r--r--environment.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/environment.c b/environment.c
index da3f7da..a5eaa97 100644
--- a/environment.c
+++ b/environment.c
@@ -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);