Blob for old side of diff, or null for empty blob
Treat old blob as if it had this filename; can be null
Blob for new side of diff, or null for empty blob
Treat new blob as if it had this filename; can be null
Options for diff, or null for default options
Callback for "file"; made once if there is a diff; can be null
Callback for binary files; can be null
Callback for each hunk in diff; can be null
Callback for each line in diff; can be null
Payload passed to each callback function
0 on success, non-zero callback return value, or error code
Directly run a diff on two blobs.
Compared to a file, a blob lacks some contextual information. As such, the git_diff_file given to the callback will have some fake data; i.e. mode will be 0 and path will be null.
null is allowed for either old_blob or new_blob and will be treated as an empty blob, with the oid set to null in the git_diff_file data. Passing null for both blobs is a noop; no callbacks will be made at all.
We do run a binary content check on the blob content and if either blob looks like binary data, the git_diff_delta binary attribute will be set to 1 and no call to the hunk_cb nor line_cb will be made (unless you pass git_diff_option_t.GIT_DIFF_FORCE_TEXT of course).