aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2006-04-03 15:18:48 -0700
committerJunio C Hamano <junkio@cox.net>2006-04-04 00:09:42 -0700
commit5941a9e9d882b12dcc2a80e55acb25c180475529 (patch)
tree475d777484e11487fefde047793722e9ad54a343
parent40e907bff260a94306b1fe43d0fb829bf54e3103 (diff)
downloadgit-5941a9e9d882b12dcc2a80e55acb25c180475529.tar.gz
git-5941a9e9d882b12dcc2a80e55acb25c180475529.tar.xz
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>
-rwxr-xr-xcontrib/git-svn/git-svn.perl9
1 files changed, 6 insertions, 3 deletions
diff --git a/contrib/git-svn/git-svn.perl b/contrib/git-svn/git-svn.perl
index edfb19c39..e7fff46d2 100755
--- a/contrib/git-svn/git-svn.perl
+++ b/contrib/git-svn/git-svn.perl
@@ -77,10 +77,13 @@ foreach my $o (keys %opts) {
$arg .= ' --bool' if ($o !~ /=[sfi]$/);
$arg .= " svn.$key"; # $key only matches [a-z\-], always shell-safe
if (ref $v eq 'ARRAY') {
- chomp(@$v = `$arg`);
+ chomp(my @tmp = `$arg`);
+ @$v = @tmp if @tmp;
} else {
- chomp($$v = `$arg`);
- $$v = 0 if $$v eq 'false';
+ chomp(my $tmp = `$arg`);
+ if ($tmp && !($arg =~ / --bool / && $tmp eq 'false')) {
+ $$v = $tmp;
+ }
}
}