Merge branch 'ws/single-file-cone'

The logic to see if we are using the "cone" mode by checking the
sparsity patterns has been tightened to avoid mistaking a pattern
that names a single file as specifying a cone.

* ws/single-file-cone:
  dir: check for single file cone patterns
This commit is contained in:
Junio C Hamano
2023-01-16 12:07:47 -08:00
2 changed files with 17 additions and 1 deletions

7
dir.c
View File

@ -732,6 +732,13 @@ static void add_pattern_to_hashsets(struct pattern_list *pl, struct path_pattern
goto clear_hashmaps;
}
if (!(given->flags & PATTERN_FLAG_MUSTBEDIR) &&
strcmp(given->pattern, "/*")) {
/* Not a cone pattern. */
warning(_("unrecognized pattern: '%s'"), given->pattern);
goto clear_hashmaps;
}
prev = given->pattern;
cur = given->pattern + 1;
next = given->pattern + 2;