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
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user