diff options
author | Jakub Narebski <jnareb@gmail.com> | 2011-07-28 23:38:03 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-07-31 18:39:19 -0700 |
commit | 14569cd810ad35a66ca7867505e0b2dd202ab95f (patch) | |
tree | 08c18f0b946c03ea76e5487852f6c52b787c0ea1 /gitweb | |
parent | 2579e1d2936ad4e385ef21e5c346d9853d7faa01 (diff) | |
download | git-14569cd810ad35a66ca7867505e0b2dd202ab95f.tar.gz |
gitweb: Git config keys are case insensitive, make config search too
"git config -z -l" that gitweb uses in git_parse_project_config() to
populate %config hash returns section and key names of config
variables in lowercase (they are case insensitive). When checking
%config in git_get_project_config() we have to take it into account.
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gitweb')
-rwxr-xr-x | gitweb/gitweb.perl | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 81dacf2b6a..73492771d2 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -2510,6 +2510,13 @@ sub git_get_project_config { # key sanity check return unless ($key); + # only subsection, if exists, is case sensitive, + # and not lowercased by 'git config -z -l' + if (my ($hi, $mi, $lo) = ($key =~ /^([^.]*)\.(.*)\.([^.]*)$/)) { + $key = join(".", lc($hi), $mi, lc($lo)); + } else { + $key = lc($key); + } $key =~ s/^gitweb\.//; return if ($key =~ m/\W/); |