git_diff_blobs

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).

@param old_blob Blob for old side of diff, or null for empty blob @param old_as_path Treat old blob as if it had this filename; can be null @param new_blob Blob for new side of diff, or null for empty blob @param new_as_path Treat new blob as if it had this filename; can be null @param options Options for diff, or null for default options @param file_cb Callback for "file"; made once if there is a diff; can be null @param binary_cb Callback for binary files; can be null @param hunk_cb Callback for each hunk in diff; can be null @param line_cb Callback for each line in diff; can be null @param payload Payload passed to each callback function @return 0 on success, non-zero callback return value, or error code

Meta