summaryrefslogtreecommitdiff
path: root/builtin/config.c
diff options
context:
space:
mode:
authorAlex Riesen <raa.lkml@gmail.com>2010-03-26 22:53:57 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-03-28 16:48:25 (GMT)
commit8b1fa778676ae94f7a6d4113fa90947b548154dd (patch)
treeebdd33abc21f7dc32fa413bdf6b77b651c0daeda /builtin/config.c
parentf1ba1c90e1704e937ff59ee510a8d46a5ab52a1a (diff)
downloadgit-8b1fa778676ae94f7a6d4113fa90947b548154dd.zip
git-8b1fa778676ae94f7a6d4113fa90947b548154dd.tar.gz
git-8b1fa778676ae94f7a6d4113fa90947b548154dd.tar.bz2
Allow passing of configuration parameters in the command line
The values passed this way will override whatever is defined in the config files. Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/config.c')
-rw-r--r--builtin/config.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/builtin/config.c b/builtin/config.c
index 4bc46b1..f3d1660 100644
--- a/builtin/config.c
+++ b/builtin/config.c
@@ -197,7 +197,11 @@ static int get_value(const char *key_, const char *regex_)
git_config_from_file(show_config, system_wide, NULL);
if (do_all && global)
git_config_from_file(show_config, global, NULL);
- git_config_from_file(show_config, local, NULL);
+ if (do_all)
+ git_config_from_file(show_config, local, NULL);
+ git_config_from_parameters(show_config, NULL);
+ if (!do_all && !seen)
+ git_config_from_file(show_config, local, NULL);
if (!do_all && !seen && global)
git_config_from_file(show_config, global, NULL);
if (!do_all && !seen && system_wide)