Re: [PATCH 3/5] introduce GIT_WORK_TREE environment variable
Matthias Lederhofer <matled@gmx.net> wrote:
> diff --git a/setup.c b/setup.c
Show 18 quoted lines
> const char *setup_git_directory_gently(int *nongit_ok)
> {
> static char cwd[PATH_MAX+1];
> @@ -199,21 +211,93 @@ const char *setup_git_directory_gently(int *nongit_ok)
> int len, offset;
>
> /*
> - * If GIT_DIR is set explicitly, we're not going
> - * to do any discovery, but we still do repository
> - * validation.
> + * If GIT_DIR is set explicitly, we do repository validation
> + * and check for GIT_WORK_TREE as working tree.
> */
> gitdirenv = getenv(GIT_DIR_ENVIRONMENT);
> if (gitdirenv) {
> + const char *gitwt;
> + char worktree[PATH_MAX+1], gitdir[PATH_MAX+1];
> + int len; ^^^^^^^^
This is not really needed because there is already a variable len of
the same type.