merge: any non-zero return from the user is an error This fixes #1703.
diff --git a/src/merge.c b/src/merge.c
index b07e8c5..a22801e 100644
--- a/src/merge.c
+++ b/src/merge.c
@@ -285,7 +285,7 @@ int git_repository_mergehead_foreach(git_repository *repo,
if ((error = git_oid_fromstr(&oid, line)) < 0)
goto cleanup;
- if (cb(&oid, payload) < 0) {
+ if (cb(&oid, payload) != 0) {
error = GIT_EUSER;
goto cleanup;
}