Commit da13787b authored by David Hewitt's avatar David Hewitt
Browse files

ggit_diff_foreach: Prevent assertions with null callbacks

These callbacks are marked as `allow-none`, so `NULL` should be allowed for them. But the method does nothing if we don't supply any callbacks, so presumably that's what this assert was intended for. However, it currently fails if ANY of the callbacks are `NULL`, we only want it to fail if ALL of the callbacks are `NULL`.
parent 05a4fb1a
Pipeline #411424 passed with stage
in 3 minutes and 2 seconds
......@@ -670,7 +670,7 @@ ggit_diff_foreach (GgitDiff *diff,
git_diff_line_cb real_line_cb = NULL;
g_return_if_fail (GGIT_IS_DIFF (diff));
g_return_if_fail (file_cb != NULL && binary_cb != NULL && hunk_cb != NULL && line_cb != NULL);
g_return_if_fail (file_cb != NULL || binary_cb != NULL || hunk_cb != NULL || line_cb != NULL);
g_return_if_fail (error == NULL || *error == NULL);
wrapper_data_init (&wrapper_data);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment