diff options
author | Junio C Hamano <gitster@pobox.com> | 2024-03-05 09:44:42 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-03-05 09:44:42 -0800 |
commit | 6249de53a3016e33dd32ef83620068f19a4e08af (patch) | |
tree | 47b3177ed5f6e8016deedaa410226d6c5391c448 /userdiff.c | |
parent | b387623c12f3f4a376e4d35a610fd3e55d7ea907 (diff) | |
parent | affe355fe706d79ce6959277c39a7f1b1ec35f58 (diff) |
Merge branch 'jk/textconv-cache-outside-repo-fix'
The code incorrectly attempted to use textconv cache when asked,
even when we are not running in a repository, which has been
corrected.
* jk/textconv-cache-outside-repo-fix:
userdiff: skip textconv caching when not in a repository
Diffstat (limited to 'userdiff.c')
-rw-r--r-- | userdiff.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/userdiff.c b/userdiff.c index 2b1dab2649..92ef649c99 100644 --- a/userdiff.c +++ b/userdiff.c @@ -3,6 +3,7 @@ #include "userdiff.h" #include "attr.h" #include "strbuf.h" +#include "environment.h" static struct userdiff_driver *drivers; static int ndrivers; @@ -459,7 +460,8 @@ struct userdiff_driver *userdiff_get_textconv(struct repository *r, if (!driver->textconv) return NULL; - if (driver->textconv_want_cache && !driver->textconv_cache) { + if (driver->textconv_want_cache && !driver->textconv_cache && + have_git_dir()) { struct notes_cache *c = xmalloc(sizeof(*c)); struct strbuf name = STRBUF_INIT; |