| 546 | } |
| 547 | |
| 548 | struct userdiff_driver *userdiff_get_textconv(struct repository *r, |
| 549 | struct userdiff_driver *driver) |
| 550 | { |
| 551 | if (!driver->textconv) |
| 552 | return NULL; |
| 553 | |
| 554 | if (driver->textconv_want_cache && !driver->textconv_cache && |
| 555 | have_git_dir()) { |
| 556 | struct notes_cache *c = xmalloc(sizeof(*c)); |
| 557 | struct strbuf name = STRBUF_INIT; |
| 558 | |
| 559 | strbuf_addf(&name, "textconv/%s", driver->name); |
| 560 | notes_cache_init(r, c, name.buf, driver->textconv); |
| 561 | driver->textconv_cache = c; |
| 562 | strbuf_release(&name); |
| 563 | } |
| 564 | |
| 565 | return driver; |
| 566 | } |
| 567 | |
| 568 | static int for_each_userdiff_driver_list(each_userdiff_driver_fn fn, |
| 569 | enum userdiff_driver_type type, void *cb_data, |
no test coverage detected