summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2014-03-25 10:33:18 -0700
committerEdward Thomson <ethomson@edwardthomson.com>2014-03-25 10:33:18 -0700
commit451aaf866af2d974380a2d141626f450212f40f2 (patch)
tree780c2db94ab7f589c646fa3fb05375031bdc830c /include
parentf210cb5b1442f82e2f930909d8430f7cc6661c5f (diff)
parent34ffe22344d32d1574dc33d3c3d20556fdb152a7 (diff)
downloadlibgit2-451aaf866af2d974380a2d141626f450212f40f2.tar.gz
Merge pull request #2181 from anuraggup/hide_cb
Callback function to hide commit and its parents in revision walker
Diffstat (limited to 'include')
-rw-r--r--include/git2/revwalk.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/git2/revwalk.h b/include/git2/revwalk.h
index aef0b5fa6..1bd6186f3 100644
--- a/include/git2/revwalk.h
+++ b/include/git2/revwalk.h
@@ -261,6 +261,30 @@ GIT_EXTERN(void) git_revwalk_free(git_revwalk *walk);
*/
GIT_EXTERN(git_repository *) git_revwalk_repository(git_revwalk *walk);
+/**
+ * This is a callback function that user can provide to hide a
+ * commit and its parents. If the callback function returns non-zero value,
+ * then this commit and its parents will be hidden.
+ *
+ * @param commit_id oid of Commit
+ * @param payload User-specified pointer to data to be passed as data payload
+ */
+typedef int(*git_revwalk_hide_cb)(
+ const git_oid *commit_id,
+ void *payload);
+
+/**
+ * Adds a callback function to hide a commit and its parents
+ *
+ * @param walk the revision walker
+ * @param hide_cb callback function to hide a commit and its parents
+ * @param payload data payload to be passed to callback function
+ */
+GIT_EXTERN(int) git_revwalk_add_hide_cb(
+ git_revwalk *walk,
+ git_revwalk_hide_cb hide_cb,
+ void *payload);
+
/** @} */
GIT_END_DECL
#endif