summaryrefslogtreecommitdiff
path: root/include/git2/notes.h
diff options
context:
space:
mode:
authorVicent Martí <tanoku@gmail.com>2012-05-14 13:17:19 -0700
committerVicent Martí <tanoku@gmail.com>2012-05-14 13:17:19 -0700
commit87d6138e2e774b1e343695b6b6ee64904f1fa53a (patch)
treebdd7f27cec27f6b39451d3ce9baf83c03e8ec4e2 /include/git2/notes.h
parent79fdde494f26cda54e7ed285e7ad82eef51245e1 (diff)
parent86ecd84427b96595338d510346e7e01bf29d4266 (diff)
downloadlibgit2-87d6138e2e774b1e343695b6b6ee64904f1fa53a.tar.gz
Merge pull request #696 from nulltoken/topic/notes-list
Add git_note_foreach()
Diffstat (limited to 'include/git2/notes.h')
-rw-r--r--include/git2/notes.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/git2/notes.h b/include/git2/notes.h
index ecb37f3ab..7b2ac1fa0 100644
--- a/include/git2/notes.h
+++ b/include/git2/notes.h
@@ -102,6 +102,27 @@ GIT_EXTERN(void) git_note_free(git_note *note);
*/
GIT_EXTERN(int) git_note_default_ref(const char **out, git_repository *repo);
+/**
+ * Loop over all the notes within a specified namespace
+ * and issue a callback for each one.
+ *
+ * @param repo Repository where to find the notes.
+ *
+ * @param notes_ref OID reference to read from (optional); defaults to "refs/notes/commits".
+ *
+ * @param note_cb Callback to invoke per found annotation.
+ *
+ * @param payload Extra parameter to callback function.
+ *
+ * @return GIT_SUCCESS or an error code.
+ */
+GIT_EXTERN(int) git_note_foreach(
+ git_repository *repo,
+ const char *notes_ref,
+ int (*note_cb)(const git_oid *note_oid, const git_oid *annotated_object_oid, void *payload),
+ void *payload
+);
+
/** @} */
GIT_END_DECL
#endif