summaryrefslogtreecommitdiff
path: root/src/stash.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stash.c')
-rw-r--r--src/stash.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/stash.c b/src/stash.c
index 458a1e175..fb5bb2e55 100644
--- a/src/stash.c
+++ b/src/stash.c
@@ -582,13 +582,15 @@ int git_stash_foreach(
for (i = 0; i < max; i++) {
entry = git_reflog_entry_byindex(reflog, i);
- error = GITERR_CALLBACK(
- callback(i,
- git_reflog_entry_message(entry),
- git_reflog_entry_id_new(entry),
- payload) );
- if (error)
+ error = callback(i,
+ git_reflog_entry_message(entry),
+ git_reflog_entry_id_new(entry),
+ payload);
+
+ if (error) {
+ GITERR_CALLBACK(error);
break;
+ }
}
cleanup: