Matthias Lederhofer [off-list ref] wrote:
quoted hunk ↗ jump to hunk
diff --git a/setup.c b/setup.c
[..]
quoted hunk ↗ jump to hunk
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.