summaryrefslogtreecommitdiff
path: root/userdiff.c
diff options
context:
space:
mode:
Diffstat (limited to 'userdiff.c')
-rw-r--r--userdiff.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/userdiff.c b/userdiff.c
index f565f6731d..3a78fbf504 100644
--- a/userdiff.c
+++ b/userdiff.c
@@ -265,12 +265,14 @@ int userdiff_config(const char *k, const char *v)
return 0;
}
-struct userdiff_driver *userdiff_find_by_name(const char *name) {
+struct userdiff_driver *userdiff_find_by_name(const char *name)
+{
int len = strlen(name);
return userdiff_find_by_namelen(name, len);
}
-struct userdiff_driver *userdiff_find_by_path(const char *path)
+struct userdiff_driver *userdiff_find_by_path(struct index_state *istate,
+ const char *path)
{
static struct attr_check *check;
@@ -278,7 +280,7 @@ struct userdiff_driver *userdiff_find_by_path(const char *path)
check = attr_check_initl("diff", NULL);
if (!path)
return NULL;
- git_check_attr(&the_index, path, check);
+ git_check_attr(istate, path, check);
if (ATTR_TRUE(check->items[0].value))
return &driver_true;
@@ -289,7 +291,8 @@ struct userdiff_driver *userdiff_find_by_path(const char *path)
return userdiff_find_by_name(check->items[0].value);
}
-struct userdiff_driver *userdiff_get_textconv(struct userdiff_driver *driver)
+struct userdiff_driver *userdiff_get_textconv(struct repository *r,
+ struct userdiff_driver *driver)
{
if (!driver->textconv)
return NULL;
@@ -299,7 +302,7 @@ struct userdiff_driver *userdiff_get_textconv(struct userdiff_driver *driver)
struct strbuf name = STRBUF_INIT;
strbuf_addf(&name, "textconv/%s", driver->name);
- notes_cache_init(c, name.buf, driver->textconv);
+ notes_cache_init(r, c, name.buf, driver->textconv);
driver->textconv_cache = c;
strbuf_release(&name);
}