summaryrefslogtreecommitdiff
path: root/userdiff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-08-16 18:23:24 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-08-16 18:23:24 (GMT)
commite10e476fb170a99ecc535a31def69d5e3483a859 (patch)
tree6987fb0785bcbdb69b5a7ad1ec5652df4a49b80c /userdiff.c
parent2a6f08ac1f6949ed0072aed3240bc04d80051851 (diff)
parent0508fe533dfe1b890f6a2d31ca42ba25466e8ff5 (diff)
downloadgit-e10e476fb170a99ecc535a31def69d5e3483a859.zip
git-e10e476fb170a99ecc535a31def69d5e3483a859.tar.gz
git-e10e476fb170a99ecc535a31def69d5e3483a859.tar.bz2
Merge branch 'jk/combine-diff-binary-etc' into maint
* jk/combine-diff-binary-etc: combine-diff: respect textconv attributes refactor get_textconv to not require diff_filespec combine-diff: handle binary files as binary combine-diff: calculate mode_differs earlier combine-diff: split header printing into its own function
Diffstat (limited to 'userdiff.c')
-rw-r--r--userdiff.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/userdiff.c b/userdiff.c
index e55310c..01d3a8b 100644
--- a/userdiff.c
+++ b/userdiff.c
@@ -281,3 +281,20 @@ struct userdiff_driver *userdiff_find_by_path(const char *path)
return NULL;
return userdiff_find_by_name(check.value);
}
+
+struct userdiff_driver *userdiff_get_textconv(struct userdiff_driver *driver)
+{
+ if (!driver->textconv)
+ return NULL;
+
+ if (driver->textconv_want_cache && !driver->textconv_cache) {
+ struct notes_cache *c = xmalloc(sizeof(*c));
+ struct strbuf name = STRBUF_INIT;
+
+ strbuf_addf(&name, "textconv/%s", driver->name);
+ notes_cache_init(c, name.buf, driver->textconv);
+ driver->textconv_cache = c;
+ }
+
+ return driver;
+}