Skip to content

Commit

Permalink
Merge branch 'pp/gitweb-config-underscore'
Browse files Browse the repository at this point in the history
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
  • Loading branch information
gitster committed Nov 29, 2012
2 parents 1cab289 + af50794 commit 36ea7ce
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions gitweb/gitweb.perl
Expand Up @@ -540,7 +540,7 @@ sub evaluate_uri {
# $feature{'remote_heads'}{'default'} = [1]; # $feature{'remote_heads'}{'default'} = [1];
# To have project specific config enable override in $GITWEB_CONFIG # To have project specific config enable override in $GITWEB_CONFIG
# $feature{'remote_heads'}{'override'} = 1; # $feature{'remote_heads'}{'override'} = 1;
# and in project config gitweb.remote_heads = 0|1; # and in project config gitweb.remoteheads = 0|1;
'remote_heads' => { 'remote_heads' => {
'sub' => sub { feature_bool('remote_heads', @_) }, 'sub' => sub { feature_bool('remote_heads', @_) },
'override' => 0, 'override' => 0,
Expand Down Expand Up @@ -2696,12 +2696,15 @@ sub git_get_project_config {
# only subsection, if exists, is case sensitive, # only subsection, if exists, is case sensitive,
# and not lowercased by 'git config -z -l' # and not lowercased by 'git config -z -l'
if (my ($hi, $mi, $lo) = ($key =~ /^([^.]*)\.(.*)\.([^.]*)$/)) { if (my ($hi, $mi, $lo) = ($key =~ /^([^.]*)\.(.*)\.([^.]*)$/)) {
$lo =~ s/_//g;
$key = join(".", lc($hi), $mi, lc($lo)); $key = join(".", lc($hi), $mi, lc($lo));
return if ($lo =~ /\W/ || $hi =~ /\W/);
} else { } else {
$key = lc($key); $key = lc($key);
$key =~ s/_//g;
return if ($key =~ /\W/);
} }
$key =~ s/^gitweb\.//; $key =~ s/^gitweb\.//;
return if ($key =~ m/\W/);


# type sanity check # type sanity check
if (defined $type) { if (defined $type) {
Expand Down

0 comments on commit 36ea7ce

Please sign in to comment.