summaryrefslogtreecommitdiff
path: root/include/git2/notes.h
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2012-05-08 17:58:40 +0200
committernulltoken <emeric.fermas@gmail.com>2012-05-14 22:07:42 +0200
commit86ecd84427b96595338d510346e7e01bf29d4266 (patch)
tree283e1b3f668c0d07ee405a539c43b74b0b286315 /include/git2/notes.h
parent1c3a5a03020f72481098780e81fc2c79a0b733db (diff)
downloadlibgit2-86ecd84427b96595338d510346e7e01bf29d4266.tar.gz
notes: add git_notes_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