Skip to content

Commit

Permalink
git-remote: fix "Use of uninitialized value in string ne"
Browse files Browse the repository at this point in the history
martin f krafft <madduck@madduck.net> writes:

> 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.

This is because there might not be branch.<name>.remote defined but
the code unconditionally dereferences $branch->{$name}{'REMOTE'} and
compares with another string.

Tested-by: Martin F Krafft <madduck@madduck.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Oct 25, 2007
1 parent 2ee52eb commit 59b2023
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion git-remote.perl
Original file line number Diff line number Diff line change
Expand Up @@ -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 unless (defined $branch->{$branchname}{'REMOTE'} &&
$branch->{$branchname}{'REMOTE'} eq $name);
my @merged = map {
s|^refs/heads/||;
$_;
Expand Down

0 comments on commit 59b2023

Please sign in to comment.