Skip to content

Commit

Permalink
SAFE_CONFIG fixup should happen in core...
Browse files Browse the repository at this point in the history
otherwise it doesn't help 'option' lines, nor gitolite git-config queries
(which see the "safe" value, which is mostly useless).
  • Loading branch information
sitaramc committed Apr 13, 2014
1 parent e3c85ad commit 17459c1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/lib/Gitolite/Conf.pm
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ sub parse {
my @matched = grep { $key =~ /^$_$/i } @validkeys;
_die "git config '$key' not allowed\ncheck GIT_CONFIG_KEYS in the rc file" if ( @matched < 1 );
_die "bad config value '$value'" if $value =~ $UNSAFE_PATT;
while ( my ( $mk, $mv ) = each %{ $rc{SAFE_CONFIG} } ) {
$value =~ s/%$mk/$mv/g;
}
add_config( 1, $key, $value );
} elsif ( $line =~ /^subconf (\S+)$/ ) {
trace( 3, $line );
Expand Down
3 changes: 0 additions & 3 deletions src/triggers/post-compile/update-git-configs
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ sub fixup_config {
while ( my ( $key, $value ) = each( %{$gc} ) ) {
next if $key =~ /^gitolite-options\./;
if ( $value ne "" ) {
while ( my ( $mk, $mv ) = each %{ $rc{SAFE_CONFIG} } ) {
$value =~ s/%$mk/$mv/g;
}
system( "git", "config", "--file", "$RB/$pr.git/config", $key, $value );
} else {
system( "git", "config", "--file", "$RB/$pr.git/config", "--unset-all", $key );
Expand Down

0 comments on commit 17459c1

Please sign in to comment.