summaryrefslogtreecommitdiff
path: root/src/notes.c
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-12-06 15:53:26 -0800
committerRussell Belfer <rb@github.com>2013-12-11 10:57:50 -0800
commitf10d7a368fa4af28b1e6f082349ffa4f62b3c00e (patch)
treebcb842ae95a85002de6508b882ff9668b52166cd /src/notes.c
parentc7b3e1b32040d05f3cb996d754a28af3b4d06d0b (diff)
downloadlibgit2-f10d7a368fa4af28b1e6f082349ffa4f62b3c00e.tar.gz
Further callback error check style fixes
Okay, I've decided I like the readability of this style much better so I used it everywhere.
Diffstat (limited to 'src/notes.c')
-rw-r--r--src/notes.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/notes.c b/src/notes.c
index e3a3fccf8..e0d5ad19e 100644
--- a/src/notes.c
+++ b/src/notes.c
@@ -582,10 +582,12 @@ 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)) &&
- !(error = GITERR_CALLBACK(
- note_cb(&note_id, &annotated_id, payload))))
- /* callback for each note */;
+ while (!(error = git_note_next(&note_id, &annotated_id, iter))) {
+ if ((error = note_cb(&note_id, &annotated_id, payload)) != 0) {
+ GITERR_CALLBACK(error);
+ break;
+ }
+ }
if (error == GIT_ITEROVER)
error = 0;