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:
Junio C Hamano
2010-12-21 14:30:52 -08:00
2 changed files with 23 additions and 2 deletions

4
diff.c
View File

@ -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);