summaryrefslogtreecommitdiff
path: root/include/git2/index.h
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-06-24 23:16:06 -0700
committerVicent Marti <tanoku@gmail.com>2013-07-10 20:50:31 +0200
commitd2ce27dd494b65f54b2d110b4defd69aea976115 (patch)
tree5e81ac8f401fd5a15f73409a6c74142a0ee5e4ca /include/git2/index.h
parentd39fff36484e908438beb17ee043689962182460 (diff)
downloadlibgit2-d2ce27dd494b65f54b2d110b4defd69aea976115.tar.gz
Add public API for pathspec matching
This adds a new public API for compiling pathspecs and matching them against the working directory, the index, or a tree from the repository. This also reworks the pathspec internals to allow the sharing of code between the existing internal usage of pathspec matching and the new external API. While this is working and the new API is ready for discussion, I think there is still an incorrect behavior in which patterns are always matched against the full path of an entry without taking the subdirectories into account (so "s*" will match "subdir/file" even though it wouldn't with core Git). Further enhancements are coming, but this was a good place to take a functional snapshot.
Diffstat (limited to 'include/git2/index.h')
-rw-r--r--include/git2/index.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/git2/index.h b/include/git2/index.h
index 51694aded..1fb77efa3 100644
--- a/include/git2/index.h
+++ b/include/git2/index.h
@@ -138,6 +138,14 @@ typedef enum {
GIT_INDEX_ADD_CHECK_PATHSPEC = (1u << 2),
} git_index_add_option_t;
+/**
+ * Match any index stage.
+ *
+ * Some index APIs take a stage to match; pass this value to match
+ * any entry matching the path regardless of stage.
+ */
+#define GIT_INDEX_STAGE_ANY -1
+
/** @name Index File Functions
*
* These functions work on the index file itself.