summaryrefslogtreecommitdiff
path: root/src/pathspec.h
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-06-19 15:20:59 -0700
committerRussell Belfer <rb@github.com>2013-06-19 15:20:59 -0700
commite91f9a8f28ca58c5ff0450749a57d233a5512f2d (patch)
treeccd206c281d87bf748350dc11590139ffde981ef /src/pathspec.h
parent84ba4944bca985195e6c32457488e514b5b37f98 (diff)
downloadlibgit2-e91f9a8f28ca58c5ff0450749a57d233a5512f2d.tar.gz
Add higher level pathspec API
Right now, setting up a pathspec to be parsed and processed requires several data structures and a couple of API calls. This adds a new high level data structure that contains all the items that you'll need and high-level APIs that do all of the setup and all of the teardown. This will make it easier to use pathspecs in various places with less repeated code.
Diffstat (limited to 'src/pathspec.h')
-rw-r--r--src/pathspec.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/pathspec.h b/src/pathspec.h
index 43a94baad..f6509df4c 100644
--- a/src/pathspec.h
+++ b/src/pathspec.h
@@ -37,4 +37,18 @@ extern bool git_pathspec_match_path(
bool casefold,
const char **matched_pathspec);
+/* easy pathspec setup */
+
+typedef struct {
+ char *prefix;
+ git_vector pathspec;
+ git_pool pool;
+} git_pathspec_context;
+
+extern int git_pathspec_context_init(
+ git_pathspec_context *ctxt, const git_strarray *paths);
+
+extern void git_pathspec_context_free(
+ git_pathspec_context *ctxt);
+
#endif