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:51 +0300
committerJunio C Hamano <gitster@pobox.com>2021-04-14 23:47:24 +0300
commite43e2a17d2d4f63a277a7fdbc32453876c25e06c (patch)
treeee35ef9809dcb2671f173ee7fb457202187e18a8 /builtin
parent299e2c4561ba6eb99e367b1f73b8ffb3cead5efa (diff)
rm: 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 'builtin')
-rw-r--r--builtin/rm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/rm.c b/builtin/rm.c
index 4858631e0f..5559a0b453 100644
--- a/builtin/rm.c
+++ b/builtin/rm.c
@@ -293,6 +293,8 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
seen = xcalloc(pathspec.nr, 1);
+ /* TODO: audit for interaction with sparse-index. */
+ ensure_full_index(&the_index);
for (i = 0; i < active_nr; i++) {
const struct cache_entry *ce = active_cache[i];
if (!ce_path_match(&the_index, ce, &pathspec, seen))