зеркало из https://github.com/microsoft/git.git
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>
This commit is contained in:
Родитель
f7ef64be0c
Коммит
465a04abc6
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче