pathspec: convert some match_pathspec_depth() to dir_path_match()
This helps reduce the number of match_pathspec_depth() call sites and show how m_p_d() is used. And it usage is: - match against an index entry (ce_path_match or match_pathspec_depth in ls-files) - match against a dir_entry from read_directory (dir_path_match and match_pathspec_depth in clean.c, which will be converted later) - resolve-undo (rerere.c and ls-files.c) Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
429bb40abd
commit
ebb32893ba
@ -552,7 +552,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) &&
|
||||
match_pathspec_depth(&s->pathspec, ent->name, ent->len, 0, NULL))
|
||||
dir_path_match(ent, &s->pathspec, 0, NULL))
|
||||
string_list_insert(&s->untracked, ent->name);
|
||||
free(ent);
|
||||
}
|
||||
@ -560,7 +560,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) &&
|
||||
match_pathspec_depth(&s->pathspec, ent->name, ent->len, 0, NULL))
|
||||
dir_path_match(ent, &s->pathspec, 0, NULL))
|
||||
string_list_insert(&s->ignored, ent->name);
|
||||
free(ent);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user