Thread (6 messages) flat view 6 messages, 5 authors, 2016-06-15

Re: git-remote: Use of uninitialized value in string ne, line 248

From: Pierre Habouzit <hidden>
Date: 2016-06-15 22:43:44

Possibly related (same subject, not in this thread)

On Wed, Oct 24, 2007 at 11:49:51AM +0000, Junio C Hamano wrote:
quoted hunk ↗ jump to hunk
martin f krafft [off-list ref] writes:
quoted
piper:~> git remote show origin
* remote origin
  URL: ssh://git.madduck.net/~/git/etc/mailplate.git
Use of uninitialized value in string ne at /usr/local/stow/git/bin/git-remote line 248.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Perhaps....

 git-remote.perl |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/git-remote.perl b/git-remote.perl
index 9ca3e7e..4cee044 100755
--- a/git-remote.perl
+++ b/git-remote.perl
@@ -244,7 +244,8 @@ sub show_remote {
 	print "* remote $name\n";
 	print "  URL: $info->{'URL'}\n";
 	for my $branchname (sort keys %$branch) {
-		next if ($branch->{$branchname}{'REMOTE'} ne $name);
+		next if (!$branch->{$branchname}{'REMOTE'} ||
+			 $branch->{$branchname}{'REMOTE'} ne $name);
  This looks better (wrt the "0" issue raised earlier):

+		next unless (defined($branch->{$branchname}{'REMOTE'}) &&
+			 $branch->{$branchname}{'REMOTE'} eq $name);

-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help