pathspec: convert some match_pathspec_depth() to ce_path_match()
This helps reduce the number of match_pathspec_depth() call sites and show how match_pathspec_depth() is used. 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
017f804efc
commit
429bb40abd
@ -728,11 +728,6 @@ int ce_same_name(const struct cache_entry *a, const struct cache_entry *b)
|
||||
return ce_namelen(b) == len && !memcmp(a->name, b->name, len);
|
||||
}
|
||||
|
||||
int ce_path_match(const struct cache_entry *ce, const struct pathspec *pathspec)
|
||||
{
|
||||
return match_pathspec_depth(pathspec, ce->name, ce_namelen(ce), 0, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* We fundamentally don't like some paths: we don't want
|
||||
* dot or dot-dot anywhere, and for obvious reasons don't
|
||||
@ -1149,8 +1144,7 @@ int refresh_index(struct index_state *istate, unsigned int flags,
|
||||
if (ignore_submodules && S_ISGITLINK(ce->ce_mode))
|
||||
continue;
|
||||
|
||||
if (pathspec &&
|
||||
!match_pathspec_depth(pathspec, ce->name, ce_namelen(ce), 0, seen))
|
||||
if (pathspec && !ce_path_match(ce, pathspec, seen))
|
||||
filtered = 1;
|
||||
|
||||
if (ce_stage(ce)) {
|
||||
|
Reference in New Issue
Block a user