summaryrefslogtreecommitdiff
path: root/builtin/rm.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2018-08-13 16:14:22 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-08-13 21:14:42 (GMT)
commit6d2df284e7f4d7cd9f46992282ef59a72a9db527 (patch)
treee574b2e2c62144926ced7a251f82260a61211d16 /builtin/rm.c
parent7f944e264ebe2fcf9a2c228a9fc9463ab3274d39 (diff)
downloadgit-6d2df284e7f4d7cd9f46992282ef59a72a9db527.zip
git-6d2df284e7f4d7cd9f46992282ef59a72a9db527.tar.gz
git-6d2df284e7f4d7cd9f46992282ef59a72a9db527.tar.bz2
dir.c: remove an implicit dependency on the_index in pathspec code
Make the match_patchspec API and friends take an index_state instead of assuming the_index in dir.c. All external call sites are converted blindly to keep the patch simple and retain current behavior. Individual call sites may receive further updates to use the right index instead of the_index. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/rm.c')
-rw-r--r--builtin/rm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/rm.c b/builtin/rm.c
index 65b448e..eebdc4a 100644
--- a/builtin/rm.c
+++ b/builtin/rm.c
@@ -278,7 +278,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
for (i = 0; i < active_nr; i++) {
const struct cache_entry *ce = active_cache[i];
- if (!ce_path_match(ce, &pathspec, seen))
+ if (!ce_path_match(&the_index, ce, &pathspec, seen))
continue;
ALLOC_GROW(list.entry, list.nr + 1, list.alloc);
list.entry[list.nr].name = xstrdup(ce->name);