@matheusbsbs / matheus-bagliano / commits / cae6c25a7f
Fork 0

diff: remove lazy config loading

There is no point to this. Either: 1. The program has already loaded git_diff_ui_config, in which case this is a noop. 2. The program didn't, which means it is plumbing that does not _want_ git_diff_ui_config to be loaded. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Jan 4, 2008 at 04:45 UTC cae6c25a7fdd7a316318c2efdc48e63cce36a68c
1 file changed -9
diff.c
-9
@@ -59,14 +59,6 @@ static struct ll_diff_driver {
59 char *cmd;
60 } *user_diff, **user_diff_tail;
61
62 -static void read_config_if_needed(void)
63 -{
64 - if (!user_diff_tail) {
65 - user_diff_tail = &user_diff;
66 - git_config(git_diff_ui_config);
67 - }
68 -}
69 -
62 /*
63 * Currently there is only "diff.<drivername>.command" variable;
64 * because there are "diff.color.<slot>" variables, we are parsing
@@ -1822,7 +1814,6 @@ static const char *external_diff_attr(const char *name)
1814 !ATTR_UNSET(value)) {
1815 struct ll_diff_driver *drv;
1816
1825 - read_config_if_needed();
1817 for (drv = user_diff; drv; drv = drv->next)
1818 if (!strcmp(drv->name, value))
1819 return drv->cmd;