Merge branch 'nd/pathspec-wildcard'

Optimize matching paths with common forms of pathspecs that contain
wildcard characters.

* nd/pathspec-wildcard:
  tree_entry_interesting: do basedir compare on wildcard patterns when possible
  pathspec: apply "*.c" optimization from exclude
  pathspec: do exact comparison on the leading non-wildcard part
  pathspec: save the non-wildcard length part
This commit is contained in:
Junio C Hamano
2013-01-05 23:40:15 -08:00
6 changed files with 120 additions and 11 deletions

View File

@ -473,6 +473,8 @@ extern int index_name_is_other(const struct index_state *, const char *, int);
extern int ie_match_stat(const struct index_state *, struct cache_entry *, struct stat *, unsigned int);
extern int ie_modified(const struct index_state *, struct cache_entry *, struct stat *, unsigned int);
#define PATHSPEC_ONESTAR 1 /* the pathspec pattern sastisfies GFNM_ONESTAR */
struct pathspec {
const char **raw; /* get_pathspec() result, not freed by free_pathspec() */
int nr;
@ -482,7 +484,8 @@ struct pathspec {
struct pathspec_item {
const char *match;
int len;
unsigned int use_wildcard:1;
int nowildcard_len;
int flags;
} *items;
};