Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-07-09 09:46:36 +0400
committerVicent Marti <tanoku@gmail.com>2013-07-10 22:50:33 +0400
commit2b672d5b646edf94ae315a9f968611ff65508c90 (patch)
tree3902904ccac637c075418e2dbfbbaabc826dd6ab /src/array.h
parent6fc5a58197bf04e1b5c6ca1bdb5765e90d3eb106 (diff)
Add git_pathspec_match_diff API
This adds an additional pathspec API that will match a pathspec against a diff object. This is convenient if you want to handle renames (so you need the whole diff and can't use the pathspec constraint built into the diff API) but still want to tell if the diff had any files that matched the pathspec. When the pathspec is matched against a diff, instead of keeping a list of filenames that matched, instead the API keeps the list of git_diff_deltas that matched and they can be retrieved via a new API git_pathspec_match_list_diff_entry. There are a couple of other minor API extensions here that were mostly for the sake of convenience and to reduce dependencies on knowing the internal data structure between files inside the library.
Diffstat (limited to 'src/array.h')
-rw-r--r--src/array.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/array.h b/src/array.h
index 707570624..248010425 100644
--- a/src/array.h
+++ b/src/array.h
@@ -66,4 +66,6 @@ GIT_INLINE(void *) git_array_grow(git_array_generic_t *a, size_t item_size)
#define git_array_size(a) (a).size
+#define git_array_valid_index(a, i) ((i) < (a).size)
+
#endif