summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/diff.c b/diff.c
index 48e5f9c..5275c4b 100644
--- a/diff.c
+++ b/diff.c
@@ -5270,6 +5270,29 @@ size_t fill_textconv(struct userdiff_driver *driver,
return size;
}
+int textconv_object(const char *path,
+ unsigned mode,
+ const struct object_id *oid,
+ int oid_valid,
+ char **buf,
+ unsigned long *buf_size)
+{
+ struct diff_filespec *df;
+ struct userdiff_driver *textconv;
+
+ df = alloc_filespec(path);
+ fill_filespec(df, oid->hash, oid_valid, mode);
+ textconv = get_textconv(df);
+ if (!textconv) {
+ free_filespec(df);
+ return 0;
+ }
+
+ *buf_size = fill_textconv(textconv, df, buf);
+ free_filespec(df);
+ return 1;
+}
+
void setup_diff_pager(struct diff_options *opt)
{
/*