Message ID | pull.1723.git.git.1716306532869.gitgitgadget@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | dir: fix treat_leading_path() to return false on non-directories | expand |
diff --git a/dir.c b/dir.c index 2d83f3311a7..5cb56f3a3e2 100644 --- a/dir.c +++ b/dir.c @@ -2771,8 +2771,10 @@ static int treat_leading_path(struct dir_struct *dir, baselen = cp - path; strbuf_reset(&sb); strbuf_add(&sb, path, baselen); - if (!is_directory(sb.buf)) + if (!is_directory(sb.buf)) { + state = path_none; break; + } strbuf_reset(&sb); strbuf_add(&sb, path, prevlen); strbuf_reset(&subdir);