summaryrefslogtreecommitdiff
path: root/setup.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2018-03-03 11:35:55 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-03-05 19:14:03 (GMT)
commit357a03ebe9e04329705a46ff36d526c5ab0c3ebc (patch)
treec95809c925390ceae12fa925af722576c5675afe /setup.c
parentb2f0eceecf266e60fa95970e0973a8f23f911fb1 (diff)
downloadgit-357a03ebe9e04329705a46ff36d526c5ab0c3ebc.zip
git-357a03ebe9e04329705a46ff36d526c5ab0c3ebc.tar.gz
git-357a03ebe9e04329705a46ff36d526c5ab0c3ebc.tar.bz2
repository.c: move env-related setup code back to environment.c
It does not make sense that generic repository code contains handling of environment variables, which are specific for the main repository only. Refactor repo_set_gitdir() function to take $GIT_DIR and optionally _all_ other customizable paths. These optional paths can be NULL and will be calculated according to the default directory layout. Note that some dead functions are left behind to reduce diff noise. They will be deleted in the next patch. 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 'setup.c')
-rw-r--r--setup.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/setup.c b/setup.c
index c5d55dc..6fac1bb 100644
--- a/setup.c
+++ b/setup.c
@@ -1116,8 +1116,7 @@ const char *setup_git_directory_gently(int *nongit_ok)
const char *gitdir = getenv(GIT_DIR_ENVIRONMENT);
if (!gitdir)
gitdir = DEFAULT_GIT_DIR_ENVIRONMENT;
- repo_set_gitdir(the_repository, gitdir);
- setup_git_env();
+ setup_git_env(gitdir);
}
if (startup_info->have_repository)
repo_set_hash_algo(the_repository, repo_fmt.hash_algo);