[PATCH 3/4] contrib/git-svn: ensure repo-config returns a value before using it

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Eric Wong <normalperson@xxxxxxxx>

---

 contrib/git-svn/git-svn.perl |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

029626bf987cff7ba42d8158c687cf4902765968
diff --git a/contrib/git-svn/git-svn.perl b/contrib/git-svn/git-svn.perl
index edfb19c..e7fff46 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;
+		}
 	}
 }
 
-- 
1.3.0.rc1.g595e

-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]