contrib/git-svn: handle array values correctly

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Eric Wong 2006-04-03 17:41:44 -07:00 committed by Junio C Hamano
parent 5f2f424002
commit fc9957b005

View File

@ -75,12 +75,11 @@ foreach my $o (keys %opts) {
my $arg = 'git-repo-config';
$arg .= ' --int' if ($o =~ /=i$/);
$arg .= ' --bool' if ($o !~ /=[sfi]$/);
$arg .= " svn.$key"; # $key only matches [a-z\-], always shell-safe
if (ref $v eq 'ARRAY') {
chomp(my @tmp = `$arg`);
chomp(my @tmp = `$arg --get-all svn.$key`);
@$v = @tmp if @tmp;
} else {
chomp(my $tmp = `$arg`);
chomp(my $tmp = `$arg --get svn.$key`);
if ($tmp && !($arg =~ / --bool / && $tmp eq 'false')) {
$$v = $tmp;
}