Browse Source

fix: Use of uninitialized value

The subroutine did not check the case where HEAD does not verify.

Patch from Junio C Hamano <junkio@cox.net>
maint
Kay Sievers 19 years ago
parent
commit
2c5c008b46
  1. 7
      gitweb.cgi

7
gitweb.cgi

@ -404,12 +404,13 @@ sub git_read_head { @@ -404,12 +404,13 @@ sub git_read_head {
if (open my $fd, "-|", "$gitbin/git-rev-parse", "--verify", "HEAD") {
my $head = <$fd>;
close $fd;
chomp $head;
if ($head =~ m/^[0-9a-fA-F]{40}$/) {
$retval = $head;
if (defined $head && $head =~ /^([0-9a-fA-F]{40})$/) {
$retval = $1;
}
}
if (defined $oENV) {
$ENV{'GIT_DIR'} = $oENV;
}
return $retval;
}


Loading…
Cancel
Save