Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-10-24 15:49:51 +0400
committerJunio C Hamano <gitster@pobox.com>2007-10-25 05:47:50 +0400
commit59b2023fbb154bc4671782955daddf8ef3018c93 (patch)
treec133f6238847814e27bffb07c0f4d80b8c5c28b9 /git-remote.perl
parent2ee52eb17c26323b3f62538a44510aae75f09d6f (diff)
git-remote: fix "Use of uninitialized value in string ne"
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>
Diffstat (limited to 'git-remote.perl')
-rwxr-xr-xgit-remote.perl3
1 files changed, 2 insertions, 1 deletions
diff --git a/git-remote.perl b/git-remote.perl
index 8e2dc4de73..11630b1a8b 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 unless (defined $branch->{$branchname}{'REMOTE'} &&
+ $branch->{$branchname}{'REMOTE'} eq $name);
my @merged = map {
s|^refs/heads/||;
$_;