summaryrefslogtreecommitdiff
path: root/src/notes.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/notes.c')
-rw-r--r--src/notes.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/notes.c b/src/notes.c
index 7e8aecbae..e3a3fccf8 100644
--- a/src/notes.c
+++ b/src/notes.c
@@ -582,12 +582,10 @@ int git_note_foreach(
if ((error = git_note_iterator_new(&iter, repo, notes_ref)) < 0)
return error;
- while (!(error = git_note_next(&note_id, &annotated_id, iter))) {
- if (note_cb(&note_id, &annotated_id, payload)) {
- error = giterr_user_cancel();
- break;
- }
- }
+ while (!(error = git_note_next(&note_id, &annotated_id, iter)) &&
+ !(error = GITERR_CALLBACK(
+ note_cb(&note_id, &annotated_id, payload))))
+ /* callback for each note */;
if (error == GIT_ITEROVER)
error = 0;