summaryrefslogtreecommitdiff
path: root/src/diff.h
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-07-08 22:46:36 -0700
committerVicent Marti <tanoku@gmail.com>2013-07-10 20:50:33 +0200
commit2b672d5b646edf94ae315a9f968611ff65508c90 (patch)
tree3902904ccac637c075418e2dbfbbaabc826dd6ab /src/diff.h
parent6fc5a58197bf04e1b5c6ca1bdb5765e90d3eb106 (diff)
downloadlibgit2-2b672d5b646edf94ae315a9f968611ff65508c90.tar.gz
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/diff.h')
-rw-r--r--src/diff.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/diff.h b/src/diff.h
index 6ef03ee7c..d09a130bc 100644
--- a/src/diff.h
+++ b/src/diff.h
@@ -76,6 +76,8 @@ extern void git_diff_list_addref(git_diff_list *diff);
extern int git_diff_delta__cmp(const void *a, const void *b);
extern int git_diff_delta__casecmp(const void *a, const void *b);
+extern const char *git_diff_delta__path(const git_diff_delta *delta);
+
extern bool git_diff_delta__should_skip(
const git_diff_options *opts, const git_diff_delta *delta);