Browse Source

contrib/git-svn: ensure repo-config returns a value before using it

fetching from repos without an authors-file defined was broken.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
maint
Eric Wong 19 years ago committed by Junio C Hamano
parent
commit
5941a9e9d8
  1. 9
      contrib/git-svn/git-svn.perl

9
contrib/git-svn/git-svn.perl

@ -77,10 +77,13 @@ foreach my $o (keys %opts) {
$arg .= ' --bool' if ($o !~ /=[sfi]$/); $arg .= ' --bool' if ($o !~ /=[sfi]$/);
$arg .= " svn.$key"; # $key only matches [a-z\-], always shell-safe $arg .= " svn.$key"; # $key only matches [a-z\-], always shell-safe
if (ref $v eq 'ARRAY') { if (ref $v eq 'ARRAY') {
chomp(@$v = `$arg`); chomp(my @tmp = `$arg`);
@$v = @tmp if @tmp;
} else { } else {
chomp($$v = `$arg`); chomp(my $tmp = `$arg`);
$$v = 0 if $$v eq 'false'; if ($tmp && !($arg =~ / --bool / && $tmp eq 'false')) {
$$v = $tmp;
}
} }
} }



Loading…
Cancel
Save