diff options
author | Russell Belfer <rb@github.com> | 2013-08-09 10:52:35 -0700 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2013-08-09 10:52:35 -0700 |
commit | 4ba64794aee983483eef659623a765d61311ded1 (patch) | |
tree | 33b048d3b6bda96f53058f43ff6303c257fcb7fb /src/attr_file.h | |
parent | fbb6c0c84c65d5e36ad552040897cfbde83b59b2 (diff) | |
download | libgit2-4ba64794aee983483eef659623a765d61311ded1.tar.gz |
Revert PR #1462 and provide alternative fix
This rolls back the changes to fnmatch parsing from commit
2e40a60e847d6c128af23e24ea7a8efebd2427da except for the tests
that were added. Instead this adds couple of new flags that can
be passed in when attempting to parse an fnmatch pattern. Also,
this changes the pathspec match logic to special case matching a
filename with a '!' prefix against a negative pattern.
This fixes the build.
Diffstat (limited to 'src/attr_file.h')
-rw-r--r-- | src/attr_file.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/attr_file.h b/src/attr_file.h index afea1e115..3bc7c6cb8 100644 --- a/src/attr_file.h +++ b/src/attr_file.h @@ -28,6 +28,12 @@ #define GIT_ATTR_FNMATCH_ALLOWSPACE (1U << 6) #define GIT_ATTR_FNMATCH_ICASE (1U << 7) #define GIT_ATTR_FNMATCH_MATCH_ALL (1U << 8) +#define GIT_ATTR_FNMATCH_ALLOWNEG (1U << 9) +#define GIT_ATTR_FNMATCH_ALLOWMACRO (1U << 10) + +#define GIT_ATTR_FNMATCH__INCOMING \ + (GIT_ATTR_FNMATCH_ALLOWSPACE | \ + GIT_ATTR_FNMATCH_ALLOWNEG | GIT_ATTR_FNMATCH_ALLOWMACRO) extern const char *git_attr__true; extern const char *git_attr__false; @@ -115,13 +121,7 @@ extern uint32_t git_attr_file__name_hash(const char *name); * other utilities */ -extern int git_attr_fnmatch__parse_gitattr_format( - git_attr_fnmatch *spec, - git_pool *pool, - const char *source, - const char **base); - -extern int git_attr_fnmatch__parse_shellglob_format( +extern int git_attr_fnmatch__parse( git_attr_fnmatch *spec, git_pool *pool, const char *source, |