binmode STDOUT, ':utf8';
my $cgi = new CGI;
-my $version = "262";
+my $version = "263";
my $my_url = $cgi->url();
my $my_uri = $cgi->url(-absolute => 1);
my $rss_link = "";
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;
}