Code

commit: suggest --amend --reset-author to fix commiter identity
[git.git] / diff.c
diff --git a/diff.c b/diff.c
index 8256f313e4a680308a7959bdd6544f5bd461846c..fa3b29d92e39cd35b30c1572acd06e2ba2708edd 100644 (file)
--- 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);