summaryrefslogtreecommitdiff
path: root/include/git2/notes.h
diff options
context:
space:
mode:
authorRichard Ipsum <richardipsum@fastmail.co.uk>2017-03-15 11:54:45 +0000
committerRichard Ipsum <richardipsum@fastmail.co.uk>2017-10-07 00:33:23 +0100
commit7096bf1ef6b5c7c5659ea9d8c66c85bda8ef20db (patch)
treefcdc597c361623f78e3913b07eb9910ec35c0362 /include/git2/notes.h
parenta46e743d0153b9a565614776b9f3a71e0aebff25 (diff)
downloadlibgit2-7096bf1ef6b5c7c5659ea9d8c66c85bda8ef20db.tar.gz
notes: Add git_note_commit_read
This also adds tests for this function.
Diffstat (limited to 'include/git2/notes.h')
-rw-r--r--include/git2/notes.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/git2/notes.h b/include/git2/notes.h
index 1af43a89b..c6b2d9594 100644
--- a/include/git2/notes.h
+++ b/include/git2/notes.h
@@ -94,6 +94,25 @@ GIT_EXTERN(int) git_note_read(
const char *notes_ref,
const git_oid *oid);
+
+/**
+ * Read the note for an object from a note commit
+ *
+ * The note must be freed manually by the user.
+ *
+ * @param out pointer to the read note; NULL in case of error
+ * @param repo repository where to look up the note
+ * @param notes_commit a pointer to the notes commit object
+ * @param oid OID of the git object to read the note from
+ *
+ * @return 0 or an error code
+ */
+GIT_EXTERN(int) git_note_commit_read(
+ git_note **out,
+ git_repository *repo,
+ git_commit *notes_commit,
+ const git_oid *oid);
+
/**
* Get the note author
*