Re: [PATCH 1/4] repository.c: move env-related setup code back to environment.c
- From
Stefan Beller <sbeller@google.com>
- Date
- Feb 26, 2018, 20:30 UTC
- Message-ID
- <CAGZ79kZHw3qr+-0QeE3j0nSjMkob8-QOCcbHRfoZGbapQsURaw@mail.gmail.com>
- In-Reply-To
- <20180226103030.26900-2-pclouds@gmail.com>
Show 12 quoted lines
> diff --git a/setup.c b/setup.c > index c5d55dcee4..6fac1bb58a 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); > }
What makes git_dir special, such that we have to pass it in here? Could the check for getenv(GIT_DIR_ENVIRONMENT) and fallback to DEFAULT_... be part of setup_git_env() ? Oh I guess that cannot be done easily as the submodule code spcifically doesn't want to discover the git dir itself.
Show 5 quoted lines
> if (startup_info->have_repository) > repo_set_hash_algo(the_repository, repo_fmt.hash_algo); > -- > 2.16.1.435.g8f24da2e1a >