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
diff options
context:
space:
mode:
authorDerrick Stolee <dstolee@microsoft.com>2021-04-01 04:49:57 +0300
committerJunio C Hamano <gitster@pobox.com>2021-04-14 23:47:40 +0300
commit465a04abc6e5f4fe2b93c662bab0319c1667180e (patch)
treed78eee4a6bd2bac0335cb45019839de0674d9159 /pathspec.c
parentf7ef64be0cda36e5188cfc712f61ba7279311b70 (diff)
pathspec: ensure full index
Before iterating over all cache entries, ensure that a sparse index is expanded to a full index to avoid unexpected behavior. Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Reviewed-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pathspec.c')
-rw-r--r--pathspec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/pathspec.c b/pathspec.c
index b6e333965c..d67688bab7 100644
--- a/pathspec.c
+++ b/pathspec.c
@@ -36,6 +36,8 @@ void add_pathspec_matches_against_index(const struct pathspec *pathspec,
num_unmatched++;
if (!num_unmatched)
return;
+ /* TODO: audit for interaction with sparse-index. */
+ ensure_full_index(istate);
for (i = 0; i < istate->cache_nr; i++) {
const struct cache_entry *ce = istate->cache[i];
ce_path_match(istate, ce, pathspec, seen);