Skip to content

Commit

Permalink
gitweb: optimize git_summary.
Browse files Browse the repository at this point in the history
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 <robfitz@273k.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Robert Fitzsimons authored and Junio C Hamano committed Dec 23, 2006
1 parent 3fcf06b commit a979d12
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gitweb/gitweb.perl
Original file line number Diff line number Diff line change
Expand Up @@ -2911,9 +2911,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);

Expand Down Expand Up @@ -2960,7 +2960,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;
Expand Down

0 comments on commit a979d12

Please sign in to comment.