contrib/git-svn: ensure repo-config returns a value before using it
authorEric Wong <normalperson@yhbt.net>
Mon, 3 Apr 2006 22:18:48 +0000 (15:18 -0700)
committerJunio C Hamano <junkio@cox.net>
Tue, 4 Apr 2006 07:09:42 +0000 (00:09 -0700)
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>
contrib/git-svn/git-svn.perl

index edfb19c..e7fff46 100755 (executable)
@@ -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;
+               }
        }
 }