diff options
author | Vicent Martà <vicent@github.com> | 2013-05-31 14:36:08 -0700 |
---|---|---|
committer | Vicent Martà <vicent@github.com> | 2013-05-31 14:36:08 -0700 |
commit | efd5a4e16a55ff32ce0b300d3792e44aed4157f8 (patch) | |
tree | 33fa5cceec1bbb24ab919ccb21732cd1487d4fec /src/notes.c | |
parent | 1ed356dcfef449313bac3ce795f26d19423c744c (diff) | |
parent | cee695ae6b9a9f586d32d0b9460a358bfdc4fe1b (diff) | |
download | libgit2-vmg/full-ref-iterator.tar.gz |
Merge pull request #1627 from arrbee/iterator-api-improvementsvmg/full-ref-iterator
Make iterators use GIT_ITEROVER & smart advance
Diffstat (limited to 'src/notes.c')
-rw-r--r-- | src/notes.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/notes.c b/src/notes.c index 3e3db58db..beace1b50 100644 --- a/src/notes.c +++ b/src/notes.c @@ -647,18 +647,12 @@ int git_note_next( const git_index_entry *item; if ((error = git_iterator_current(&item, it)) < 0) - goto exit; + return error; - if (item != NULL) { - git_oid_cpy(note_id, &item->oid); - error = process_entry_path(item->path, annotated_id); + git_oid_cpy(note_id, &item->oid); - if (error >= 0) - error = git_iterator_advance(NULL, it); - } else { - error = GIT_ITEROVER; - } + if (!(error = process_entry_path(item->path, annotated_id))) + git_iterator_advance(NULL, it); -exit: return error; } |