summaryrefslogtreecommitdiff
path: root/include/git2/diff.h
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2012-05-08 13:56:21 -0700
committerRussell Belfer <rb@github.com>2012-05-08 13:56:21 -0700
commit364f51bdca8cd5bb11bb322f8cac1b0d7dfcf686 (patch)
tree03cb3fc3d8ecca69cfdda7d60fcc551955028dfd /include/git2/diff.h
parent1f796cd1807180bbf20d094954fd7909c6ef1ac7 (diff)
parentd1c4312a021eb165d21b7390607f2b2bcba098ae (diff)
downloadlibgit2-364f51bdca8cd5bb11bb322f8cac1b0d7dfcf686.tar.gz
Merge pull request #668 from nulltoken/topic/binary-blobs
Enhancing the blob diffing experience
Diffstat (limited to 'include/git2/diff.h')
-rw-r--r--include/git2/diff.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/git2/diff.h b/include/git2/diff.h
index 6afa608bb..bafe6268c 100644
--- a/include/git2/diff.h
+++ b/include/git2/diff.h
@@ -337,12 +337,21 @@ GIT_EXTERN(int) git_diff_print_patch(
/**
* Directly run a text diff on two blobs.
+ *
+ * Compared to a file, a blob lacks some contextual information. As such, the
+ * `git_diff_file` parameters of the callbacks will be filled accordingly to the following:
+ * `mode` will be set to 0, `path` will be set to NULL. When dealing with a NULL blob, `oid`
+ * will be set to 0.
+ *
+ * When at least one of the blobs being dealt with is binary, the `git_diff_delta` binary
+ * attribute will be set to 1 and no call to the hunk_cb nor line_cb will be made.
*/
GIT_EXTERN(int) git_diff_blobs(
git_blob *old_blob,
git_blob *new_blob,
git_diff_options *options,
void *cb_data,
+ git_diff_file_fn file_cb,
git_diff_hunk_fn hunk_cb,
git_diff_data_fn line_cb);