diff options
author | Richard Ipsum <richardipsum@fastmail.co.uk> | 2017-03-19 18:34:07 +0000 |
---|---|---|
committer | Richard Ipsum <richardipsum@fastmail.co.uk> | 2017-10-07 00:43:40 +0100 |
commit | 60bee89d4697832f88c484f0c236e7f25c3d62fe (patch) | |
tree | 9670114f2cd4510c1c195c2281a04c4d1aaeee95 /src/notes.c | |
parent | 9a02725d11acb302b0d9ef7013ae81ffd59525c7 (diff) | |
download | libgit2-60bee89d4697832f88c484f0c236e7f25c3d62fe.tar.gz |
notes: Add git_note_commit_iterator_new
This also adds tests for this function.
Diffstat (limited to 'src/notes.c')
-rw-r--r-- | src/notes.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/notes.c b/src/notes.c index 9aef8fcac..68486c9d6 100644 --- a/src/notes.c +++ b/src/notes.c @@ -766,6 +766,25 @@ cleanup: return error; } +int git_note_commit_iterator_new( + git_note_iterator **it, + git_commit *notes_commit) +{ + int error; + git_tree *tree; + + if ((error = git_commit_tree(&tree, notes_commit)) < 0) + goto cleanup; + + if ((error = git_iterator_for_tree(it, tree, NULL)) < 0) + git_iterator_free(*it); + +cleanup: + git_tree_free(tree); + + return error; +} + int git_note_next( git_oid* note_id, git_oid* annotated_id, |