From: Robert Fitzsimons Date: Fri, 22 Dec 2006 19:38:15 +0000 (+0000) Subject: gitweb: optimize git_summary. X-Git-Url: https://git.ladys.computer/Gitweb/commitdiff_plain/9910c8176a1c15391125f22718ea1e9869e79f58b61b957822508e15aec99443 gitweb: optimize git_summary. We don't need to call git_get_head_hash at all just pass in "HEAD" and use the return id field. Signed-off-by: Robert Fitzsimons Signed-off-by: Junio C Hamano --- diff --git a/gitweb.perl b/gitweb.perl index ade2fe6..11e849f 100755 --- a/gitweb.perl +++ b/gitweb.perl @@ -2912,9 +2912,9 @@ sub git_project_index { sub git_summary { my $descr = git_get_project_description($project) || "none"; - my $head = git_get_head_hash($project); - my %co = parse_commit($head); + my %co = parse_commit("HEAD"); my %cd = parse_date($co{'committer_epoch'}, $co{'committer_tz'}); + my $head = $co{'id'}; my $owner = git_get_project_owner($project); @@ -2961,7 +2961,7 @@ sub git_summary { # we need to request one more than 16 (0..15) to check if # those 16 are all open my $fd, "-|", git_cmd(), "rev-list", "--max-count=17", - git_get_head_hash($project), "--" + $head, "--" or die_error(undef, "Open git-rev-list failed"); my @revlist = map { chomp; $_ } <$fd>; close $fd;