]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: Git config keys are case insensitive, make config search too
authorJakub Narebski <redacted>
Thu, 28 Jul 2011 21:38:03 +0000 (23:38 +0200)
committerLady <redacted>
Mon, 6 Apr 2026 04:51:31 +0000 (00:51 -0400)
"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 <redacted>
Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl

index e0d2365d3994f710c21d6af0ce61547daf62be69684cef2a7b1ba96c3d137535..349c969376cc92d92f0a57edda32e7357a25c51ee5868c03fb3fec12af90bfe2 100755 (executable)
@@ -2527,6 +2527,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/);
 
This page took 0.277863 seconds and 4 git commands to generate.