summaryrefslogtreecommitdiff
path: root/builtin-diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-07-27 22:55:44 -0700
committerJunio C Hamano <junkio@cox.net>2006-07-27 22:55:44 -0700
commitef1d9c5aa4c8fd57b2a8043c0cd9fea1c507db6a (patch)
tree8e5537ca7f1be31caad67d68310d0ec3e805b3af /builtin-diff.c
parentdee4e384f376020e08cb78f6dfaf00ae84e97a9e (diff)
downloadgit-ef1d9c5aa4c8fd57b2a8043c0cd9fea1c507db6a.tar.gz
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 <junkio@cox.net>
Diffstat (limited to 'builtin-diff.c')
-rw-r--r--builtin-diff.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin-diff.c b/builtin-diff.c
index cb38f44561..7d5ad6271e 100644
--- a/builtin-diff.c
+++ b/builtin-diff.c
@@ -250,8 +250,9 @@ int cmd_diff(int argc, const char **argv, char **envp)
* Other cases are errors.
*/
- git_config(git_diff_ui_config);
init_revisions(&rev);
+ git_config(git_diff_ui_config);
+ diff_setup(&rev.diffopt);
argc = setup_revisions(argc, argv, &rev, NULL);
if (!rev.diffopt.output_format) {