@matheusbsbs / matheus-bagliano / commits / 92a39a14d0
Fork 0

cvsserver: Handle three part keys in git config correctly

This is intended to be used in the form gitcvs.<method>.<var> but this patch doesn't introduce any users yet. Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de> Signed-off-by: Junio C Hamano <junkio@cox.net>

Frank Lichtenheld committed Mar 19, 2007 at 16:55 UTC 92a39a14d00fdfe6868bacf86cbf933a2cc6be93
1 file changed +6 -2
git-cvsserver.perl
+6 -2
@@ -183,8 +183,12 @@ sub req_Root
183 }
184 foreach my $line ( @gitvars )
185 {
186 - next unless ( $line =~ /^(.*?)\.(.*?)=(.*)$/ );
187 - $cfg->{$1}{$2} = $3;
186 + next unless ( $line =~ /^(.*?)\.(.*?)(?:\.(.*?))?=(.*)$/ );
187 + unless ($3) {
188 + $cfg->{$1}{$2} = $4;
189 + } else {
190 + $cfg->{$1}{$2}{$3} = $4;
191 + }
192 }
193
194 unless ( defined ( $cfg->{gitcvs}{enabled} ) and $cfg->{gitcvs}{enabled} =~ /^\s*(1|true|yes)\s*$/i )