summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2010-12-21 14:30:52 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2010-12-21 14:30:52 -0800
commit6ae7a51a2e8efdb10c18d59693e647a73d98d9d3 (patch)
tree80c68993f0b56ce5b0046449e6c261e6738a5890 /diff.c
parentMerge branch 'jk/t2107-now-passes' (diff)
parentfill_textconv(): Don't get/put cache if sha1 is not valid (diff)
downloadtgif-6ae7a51a2e8efdb10c18d59693e647a73d98d9d3.tar.xz
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
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/diff.c b/diff.c
index 0a43869435..5422c43882 100644
--- a/diff.c
+++ b/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);