git_diff_buffers

Directly run a diff between two buffers.

Even more than with git_diff_blobs, comparing two buffer lacks context, so the git_diff_file parameters to the callbacks will be faked a la the rules for git_diff_blobs().

extern (C) nothrow @nogc
int
git_diff_buffers

Parameters

old_buffer const(void)*

Raw data for old side of diff, or null for empty

old_len size_t

Length of the raw data for old side of the diff

old_as_path const(char)*

Treat old buffer as if it had this filename; can be null

new_buffer const(void)*

Raw data for new side of diff, or null for empty

new_len size_t

Length of raw data for new side of diff

new_as_path const(char)*

Treat buffer as if it had this filename; can be null

options const(.git_diff_options)*

Options for diff, or null for default options

file_cb .git_diff_file_cb

Callback for "file"; made once if there is a diff; can be null

binary_cb .git_diff_binary_cb

Callback for binary files; can be null

hunk_cb .git_diff_hunk_cb

Callback for each hunk in diff; can be null

line_cb .git_diff_line_cb

Callback for each line in diff; can be null

payload void*

Payload passed to each callback function

Return Value

Type: int

0 on success, non-zero callback return value, or error code

Meta