From ef1d9c5aa4c8fd57b2a8043c0cd9fea1c507db6a Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 27 Jul 2006 22:55:44 -0700 Subject: log and diff family: honor config even from subdirectories There currently is an unfortunate circular dependency between what init_revisions (the command line revision specification parser) does and setting up the log and diff options. The function uses setup_git_directory() to find the root of the project relative to the current directory and calls diff_setup() to prepare diff generation. However, some of the things that diff_setup() does needs to depend on the configuration variable, which needs to be read after setup_git_directory() is called. This patch is a low impact workaround. It first lets init_revisions() to run and do its thing, then uses git_config() and diff_setup() after it returns, so that configuration variables that affects the diff operation can be used from subdirectories. Signed-off-by: Junio C Hamano --- builtin-diff-index.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'builtin-diff-index.c') diff --git a/builtin-diff-index.c b/builtin-diff-index.c index a1fa1b85cf..dc52c054ee 100644 --- a/builtin-diff-index.c +++ b/builtin-diff-index.c @@ -15,8 +15,8 @@ int cmd_diff_index(int argc, const char **argv, char **envp) int cached = 0; int i; - git_config(git_default_config); /* no "diff" UI options */ init_revisions(&rev); + git_config(git_default_config); /* no "diff" UI options */ rev.abbrev = 0; argc = setup_revisions(argc, argv, &rev, NULL); -- cgit v1.2.3