]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: optimize git_summary.
authorRobert Fitzsimons <redacted>
Fri, 22 Dec 2006 19:38:15 +0000 (19:38 +0000)
committerLady <redacted>
Mon, 6 Apr 2026 04:07:11 +0000 (00:07 -0400)
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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl

index ade2fe6109155275d3589ac5b34028b9968c1edc17762363aea0b079be7ac0f4..11e849fc8661314b2728d760eb196ea42dc66d38ebfd0b8e9697763229ff11b8 100755 (executable)
@@ -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;
This page took 0.284449 seconds and 4 git commands to generate.