git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
EWEric Wong <normalperson@yhbt.net>
Date
Apr 3, 2006, 22:18 UTC
Message-ID
<11441027292908-git-send-email-normalperson@yhbt.net>
fetching from repos without an authors-file defined was broken.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
 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
Next: Eric Wong
Message 1 of 3 in “contrib/git-svn: ensure repo-config returns a value before using it”
  1. 3/4 contrib/git-svn: ensure repo-config returns a value before using itEric Wong, Apr 3, 2006
  2. 4/4 contrib/git-svn: make sure our git-svn is up-to-date for testEric Wong, Apr 3, 2006
  3. Eric WongApr 3, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.