diff options
| author | Vicent Marti <tanoku@gmail.com> | 2013-04-16 17:46:41 +0200 |
|---|---|---|
| committer | Vicent Marti <tanoku@gmail.com> | 2013-04-16 17:46:41 +0200 |
| commit | a50086d174658914d4d6462afbc83b02825b1f5b (patch) | |
| tree | e8daa1c7bf678222cf351445179837bed7db3a72 /src/pathspec.h | |
| parent | 5b9fac39d8a76b9139667c26a63e6b3f204b3977 (diff) | |
| parent | f124ebd457bfbf43de3516629aaba5a279636e04 (diff) | |
| download | libgit2-a50086d174658914d4d6462afbc83b02825b1f5b.tar.gz | |
Merge branch 'development'v0.18.0
Diffstat (limited to 'src/pathspec.h')
| -rw-r--r-- | src/pathspec.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/pathspec.h b/src/pathspec.h new file mode 100644 index 000000000..43a94baad --- /dev/null +++ b/src/pathspec.h @@ -0,0 +1,40 @@ +/* + * Copyright (C) the libgit2 contributors. All rights reserved. + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. + */ +#ifndef INCLUDE_pathspec_h__ +#define INCLUDE_pathspec_h__ + +#include "common.h" +#include "buffer.h" +#include "vector.h" +#include "pool.h" + +/* what is the common non-wildcard prefix for all items in the pathspec */ +extern char *git_pathspec_prefix(const git_strarray *pathspec); + +/* is there anything in the spec that needs to be filtered on */ +extern bool git_pathspec_is_empty(const git_strarray *pathspec); + +/* build a vector of fnmatch patterns to evaluate efficiently */ +extern int git_pathspec_init( + git_vector *vspec, const git_strarray *strspec, git_pool *strpool); + +/* free data from the pathspec vector */ +extern void git_pathspec_free(git_vector *vspec); + +/* + * Match a path against the vectorized pathspec. + * The matched pathspec is passed back into the `matched_pathspec` parameter, + * unless it is passed as NULL by the caller. + */ +extern bool git_pathspec_match_path( + git_vector *vspec, + const char *path, + bool disable_fnmatch, + bool casefold, + const char **matched_pathspec); + +#endif |
