Commit 4bfd7c63fcd920af8366e521b7e985ded7cb3e84

Edward Thomson 2016-09-01T16:55:27

patch: error on diff callback failure

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/patch.c b/src/patch.c
index ad24b07..9b7c9c6 100644
--- a/src/patch.c
+++ b/src/patch.c
@@ -17,6 +17,9 @@ int git_patch__invoke_callbacks(
 	if (file_cb)
 		error = file_cb(patch->delta, 0, payload);
 
+	if (error)
+		return error;
+
 	if ((patch->delta->flags & GIT_DIFF_FLAG_BINARY) != 0) {
 		if (binary_cb)
 			error = binary_cb(patch->delta, &patch->binary, payload);