summaryrefslogtreecommitdiff
path: root/include/git2/notes.h
diff options
context:
space:
mode:
authorRichard Ipsum <richardipsum@fastmail.co.uk>2017-03-15 18:17:42 +0000
committerRichard Ipsum <richardipsum@fastmail.co.uk>2017-10-07 00:43:29 +0100
commit9a02725d11acb302b0d9ef7013ae81ffd59525c7 (patch)
tree8bf93af54d61b0bf45df4447c9b6b4c343b19cfd /include/git2/notes.h
parent7096bf1ef6b5c7c5659ea9d8c66c85bda8ef20db (diff)
downloadlibgit2-9a02725d11acb302b0d9ef7013ae81ffd59525c7.tar.gz
notes: Add git_note_commit_remove
This also adds tests for this function.
Diffstat (limited to 'include/git2/notes.h')
-rw-r--r--include/git2/notes.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/git2/notes.h b/include/git2/notes.h
index c6b2d9594..f3cde4ebf 100644
--- a/include/git2/notes.h
+++ b/include/git2/notes.h
@@ -223,6 +223,32 @@ GIT_EXTERN(int) git_note_remove(
const git_oid *oid);
/**
+ * Remove the note for an object
+ *
+ * @param notes_commit_out pointer to store the new notes commit (optional);
+ * NULL in case of error.
+ * When removing a note a new tree containing all notes
+ * sans the note to be removed is created and a new commit
+ * pointing to that tree is also created.
+ * In the case where the resulting tree is an empty tree
+ * a new commit pointing to this empty tree will be returned.
+ * @param repo repository where the note lives
+ * @param notes_commit a pointer to the notes commit object
+ * @param author signature of the notes commit author
+ * @param committer signature of the notes commit committer
+ * @param oid OID of the git object to remove the note from
+ *
+ * @return 0 or an error code
+ */
+GIT_EXTERN(int) git_note_commit_remove(
+ git_oid *notes_commit_out,
+ git_repository *repo,
+ git_commit *notes_commit,
+ const git_signature *author,
+ const git_signature *committer,
+ const git_oid *oid);
+
+/**
* Free a git_note object
*
* @param note git_note object