Merge branch 'ks/blame-worktree-textconv-cached'
* ks/blame-worktree-textconv-cached: fill_textconv(): Don't get/put cache if sha1 is not valid t/t8006: Demonstrate blame is broken when cachetextconv is on
This commit is contained in:
4
diff.c
4
diff.c
@ -4412,7 +4412,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)
|
||||
@ -4423,7 +4423,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);
|
||||
|
Reference in New Issue
Block a user