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>

Jakub Narebski committed Jul 28, 2011 at 23:38 UTC 14569cd810ad35a66ca7867505e0b2dd202ab95f
1 file changed +7
gitweb/gitweb.perl
+7
@@ -2510,6 +2510,13 @@ sub git_get_project_config {
2510
2511 # key sanity check
2512 return unless ($key);
2513 + # only subsection, if exists, is case sensitive,
2514 + # and not lowercased by 'git config -z -l'
2515 + if (my ($hi, $mi, $lo) = ($key =~ /^([^.]*)\.(.*)\.([^.]*)$/)) {
2516 + $key = join(".", lc($hi), $mi, lc($lo));
2517 + } else {
2518 + $key = lc($key);
2519 + }
2520 $key =~ s/^gitweb\.//;
2521 return if ($key =~ m/\W/);
2522