X-Git-Url: https://git.ladys.computer/Gitweb/blobdiff_plain/340c2cebf277ea98474787cf853bf5a92bb32973b2170486743668c20df7871a..3db437d9dc5c685196803352761a7d113bc8f122b8609f9bd7162a5f57e7ac24:/gitweb.cgi diff --git a/gitweb.cgi b/gitweb.cgi index db7e1b2..11a30eb 100755 --- a/gitweb.cgi +++ b/gitweb.cgi @@ -478,7 +478,16 @@ sub git_read_commit { if (!defined $co{'tree'}) { return undef }; - $co{'id'} = $commit_id; + if (!($commit_id =~ m/^[0-9a-fA-F]{40}$/)) { + # lookup hash by textual id + open my $fd, "-|", "$gitbin/git-rev-parse --verify $commit_id" or return; + my $hash_id = <$fd>; + close $fd or return; + chomp $hash_id; + $co{'id'} = $hash_id + } else { + $co{'id'} = $commit_id; + } $co{'parents'} = \@parents; $co{'parent'} = $parents[0]; $co{'comment'} = \@commit_lines; @@ -1630,7 +1639,7 @@ sub git_commit { "\n"; print "