diff --git a/diff.c b/diff.c index 8256f313e4..fa3b29d92e 100644 --- a/diff.c +++ b/diff.c @@ -4388,7 +4388,7 @@ size_t fill_textconv(struct userdiff_driver *driver, return df->size; } - if (driver->textconv_cache) { + if (driver->textconv_cache && df->sha1_valid) { *outbuf = notes_cache_get(driver->textconv_cache, df->sha1, &size); if (*outbuf) @@ -4399,7 +4399,7 @@ size_t fill_textconv(struct userdiff_driver *driver, if (!*outbuf) die("unable to read files to diff"); - if (driver->textconv_cache) { + if (driver->textconv_cache && df->sha1_valid) { /* ignore errors, as we might be in a readonly repository */ notes_cache_put(driver->textconv_cache, df->sha1, *outbuf, size); diff --git a/t/t8006-blame-textconv.sh b/t/t8006-blame-textconv.sh index fe90541842..ea64cd8d0f 100755 --- a/t/t8006-blame-textconv.sh +++ b/t/t8006-blame-textconv.sh @@ -81,8 +81,7 @@ cat >expected_one <blame && find_blame result && test_cmp expected result &&