summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-02-26 13:37:15 -0800
committerJunio C Hamano <gitster@pobox.com>2016-02-26 13:37:15 -0800
commit3ed26a44b3415f5761bdab21f823d964c20a2824 (patch)
tree332fe9b5ccddbdec65ab482e7d1100c57355f253 /diff.c
parent18b26b18c50637eaa8fb1ae5f42fd94c8ac99507 (diff)
parenta64e6a44c63a965c5bc26242ddd3ed049b42e117 (diff)
downloadgit-3ed26a44b3415f5761bdab21f823d964c20a2824.tar.gz
Merge branch 'jk/more-comments-on-textconv'
The memory ownership rule of fill_textconv() API, which was a bit tricky, has been documented a bit better. * jk/more-comments-on-textconv: diff: clarify textconv interface
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/diff.c b/diff.c
index 2136b6970b..a088e269b4 100644
--- a/diff.c
+++ b/diff.c
@@ -5085,7 +5085,7 @@ size_t fill_textconv(struct userdiff_driver *driver,
{
size_t size;
- if (!driver || !driver->textconv) {
+ if (!driver) {
if (!DIFF_FILE_VALID(df)) {
*outbuf = "";
return 0;
@@ -5096,6 +5096,9 @@ size_t fill_textconv(struct userdiff_driver *driver,
return df->size;
}
+ if (!driver->textconv)
+ die("BUG: fill_textconv called with non-textconv driver");
+
if (driver->textconv_cache && df->sha1_valid) {
*outbuf = notes_cache_get(driver->textconv_cache, df->sha1,
&size);