Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
fix: Use of uninitialized value
author
Kay Sievers
<kay.sievers@suse.de>
Tue, 17 Jan 2006 02:50:20 +0000
(
03:50
+0100)
committer
Kay Sievers
<kay.sievers@suse.de>
Tue, 17 Jan 2006 02:50:20 +0000
(
03:50
+0100)
The subroutine did not check the case where HEAD does not verify.
Patch from Junio C Hamano <junkio@cox.net>
gitweb.cgi
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
f76ddc2
)
diff --git
a/gitweb.cgi
b/gitweb.cgi
index 986d7dacd60f94dad07a1d06c1ad7853e9cf6432..cb033733b9ea5413fd34349b5cad79d83b0334d6 100755
(executable)
--- a/
gitweb.cgi
+++ b/
gitweb.cgi
@@
-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;
}
}
- $ENV{'GIT_DIR'} = $oENV;
+ if (defined $oENV) {
+ $ENV{'GIT_DIR'} = $oENV;
+ }
return $retval;
}