From: Elijah Newren via GitGitGadget Date: Wed, 29 Jan 2020 22:03:41 GMT Subject: [PATCH 4/6] dir: move setting of nested_repo next to its actual usage Message-ID: <3b2ec5eaf65c9fe44c4337a4cc2fc3dae6203d54.1580335424.git.gitgitgadget@gmail.com> In-Reply-To: From: Elijah Newren Signed-off-by: Elijah Newren --- dir.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dir.c b/dir.c index 225f0bc082..ef3307718a 100644 --- a/dir.c +++ b/dir.c @@ -1659,7 +1659,7 @@ static enum path_treatment treat_directory(struct dir_struct *dir, const char *dirname, int len, int baselen, int excluded, const struct pathspec *pathspec) { - int nested_repo = 0; + int nested_repo; /* The "len-1" is to strip the final '/' */ switch (directory_exists_in_index(istate, dirname, len-1)) { @@ -1670,6 +1670,7 @@ static enum path_treatment treat_directory(struct dir_struct *dir, return path_none; case index_nonexistent: + nested_repo = 0; if ((dir->flags & DIR_SKIP_NESTED_GIT) || !(dir->flags & DIR_NO_GITLINKS)) { struct strbuf sb = STRBUF_INIT; -- gitgitgadget