Skip to content

Commit 36ea7ce

Browse files
committed
Merge branch 'pp/gitweb-config-underscore'
The key "gitweb.remote_heads" is not legal git config; this maps it to "gitweb.remoteheads". * pp/gitweb-config-underscore: gitweb: make remote_heads config setting work
2 parents 1cab289 + af50794 commit 36ea7ce

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

gitweb/gitweb.perl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ sub evaluate_uri {
540540
# $feature{'remote_heads'}{'default'} = [1];
541541
# To have project specific config enable override in $GITWEB_CONFIG
542542
# $feature{'remote_heads'}{'override'} = 1;
543-
# and in project config gitweb.remote_heads = 0|1;
543+
# and in project config gitweb.remoteheads = 0|1;
544544
'remote_heads' => {
545545
'sub' => sub { feature_bool('remote_heads', @_) },
546546
'override' => 0,
@@ -2696,12 +2696,15 @@ sub git_get_project_config {
26962696
# only subsection, if exists, is case sensitive,
26972697
# and not lowercased by 'git config -z -l'
26982698
if (my ($hi, $mi, $lo) = ($key =~ /^([^.]*)\.(.*)\.([^.]*)$/)) {
2699+
$lo =~ s/_//g;
26992700
$key = join(".", lc($hi), $mi, lc($lo));
2701+
return if ($lo =~ /\W/ || $hi =~ /\W/);
27002702
} else {
27012703
$key = lc($key);
2704+
$key =~ s/_//g;
2705+
return if ($key =~ /\W/);
27022706
}
27032707
$key =~ s/^gitweb\.//;
2704-
return if ($key =~ m/\W/);
27052708

27062709
# type sanity check
27072710
if (defined $type) {

0 commit comments

Comments
 (0)