Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-01-16 23:07:47 +0300
committerJunio C Hamano <gitster@pobox.com>2023-01-16 23:07:47 +0300
commitab85a7de6d332b4b21f94937e6600a14c270422c (patch)
tree9f09537e443953716ca3b56d3ef8359835812cae /dir.c
parent1120c54c12788c232d96702702e719f72e7ece14 (diff)
parent5842710dc28bc7da5a1dc60c06804e39bc5fe4dd (diff)
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
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/dir.c b/dir.c
index fbdb24fc81..4e99f0c868 100644
--- a/dir.c
+++ b/dir.c
@@ -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;