git_diff_foreach

Loop over all deltas in a diff issuing callbacks.

This will iterate through all of the files described in a diff. You should provide a file callback to learn about each file.

The "hunk" and "line" callbacks are optional, and the text diff of the files will only be calculated if they are not null. Of course, these callbacks will not be invoked for binary files on the diff or for files whose only changed is a file mode change.

Returning a non-zero value from any of the callbacks will terminate the iteration and return the value to the user.

@param diff A git_diff generated by one of the above functions. @param file_cb Callback function to make per file in the diff. @param binary_cb Optional callback to make for binary files. @param hunk_cb Optional callback to make per hunk of text diff. This callback is called to describe a range of lines in the diff. It will not be issued for binary files. @param line_cb Optional callback to make per line of diff text. This same callback will be made for context lines, added, and removed lines, and even for a deleted trailing newline. @param payload Reference pointer that will be passed to your callbacks. @return 0 on success, non-zero callback return value, or error code

Meta