diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2018-03-03 14:35:57 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-03-05 22:14:03 +0300 |
commit | 7bc0dcaa6120efec8cf8caef8511c09d35dbcf09 (patch) | |
tree | a5aebaf563a84a28783059b5aae03caa4fafeece /sha1_file.c | |
parent | 0ac5af59957cc46641a6083207c9a04c1a9fa9c8 (diff) |
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 'sha1_file.c')
-rw-r--r-- | sha1_file.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/sha1_file.c b/sha1_file.c index 831d9e7343..4af422e3cf 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -667,15 +667,11 @@ int foreach_alt_odb(alt_odb_fn fn, void *cb) void prepare_alt_odb(void) { - const char *alt; - if (alt_odb_tail) return; - alt = getenv(ALTERNATE_DB_ENVIRONMENT); - alt_odb_tail = &alt_odb_list; - link_alt_odb_entries(alt, PATH_SEP, NULL, 0); + link_alt_odb_entries(the_repository->alternate_db, PATH_SEP, NULL, 0); read_info_alternates(get_object_directory(), 0); } |