From 6d2df284e7f4d7cd9f46992282ef59a72a9db527 Mon Sep 17 00:00:00 2001 From: Nguyễn Thái Ngọc Duy Date: Mon, 13 Aug 2018 18:14:22 +0200 Subject: dir.c: remove an implicit dependency on the_index in pathspec code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Junio C Hamano --- wt-status.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'wt-status.c') diff --git a/wt-status.c b/wt-status.c index 6bf2fdbab6..5ffab61015 100644 --- a/wt-status.c +++ b/wt-status.c @@ -647,7 +647,7 @@ static void wt_status_collect_changes_initial(struct wt_status *s) struct wt_status_change_data *d; const struct cache_entry *ce = active_cache[i]; - if (!ce_path_match(ce, &s->pathspec, NULL)) + if (!ce_path_match(&the_index, ce, &s->pathspec, NULL)) continue; if (ce_intent_to_add(ce)) continue; @@ -703,7 +703,7 @@ static void wt_status_collect_untracked(struct wt_status *s) for (i = 0; i < dir.nr; i++) { struct dir_entry *ent = dir.entries[i]; if (cache_name_is_other(ent->name, ent->len) && - dir_path_match(ent, &s->pathspec, 0, NULL)) + dir_path_match(&the_index, ent, &s->pathspec, 0, NULL)) string_list_insert(&s->untracked, ent->name); free(ent); } @@ -711,7 +711,7 @@ static void wt_status_collect_untracked(struct wt_status *s) for (i = 0; i < dir.ignored_nr; i++) { struct dir_entry *ent = dir.ignored[i]; if (cache_name_is_other(ent->name, ent->len) && - dir_path_match(ent, &s->pathspec, 0, NULL)) + dir_path_match(&the_index, ent, &s->pathspec, 0, NULL)) string_list_insert(&s->ignored, ent->name); free(ent); } -- cgit 1.2.3-korg