@matheusbsbs / matheus-bagliano / commits / a979d1289b
Fork 0

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 <robfitz@273k.net> Signed-off-by: Junio C Hamano <junkio@cox.net>

Robert Fitzsimons committed Dec 22, 2006 at 19:38 UTC a979d1289be6a3999d7e89bf0359ebf28075fc6b
1 file changed +3 -3
gitweb/gitweb.perl
+3 -3
@@ -2911,9 +2911,9 @@ sub git_project_index {
2911
2912 sub git_summary {
2913 my $descr = git_get_project_description($project) || "none";
2914 - my $head = git_get_head_hash($project);
2915 - my %co = parse_commit($head);
2914 + my %co = parse_commit("HEAD");
2915 my %cd = parse_date($co{'committer_epoch'}, $co{'committer_tz'});
2916 + my $head = $co{'id'};
2917
2918 my $owner = git_get_project_owner($project);
2919
@@ -2960,7 +2960,7 @@ sub git_summary {
2960 # we need to request one more than 16 (0..15) to check if
2961 # those 16 are all
2962 open my $fd, "-|", git_cmd(), "rev-list", "--max-count=17",
2963 - git_get_head_hash($project), "--"
2963 + $head, "--"
2964 or die_error(undef, "Open git-rev-list failed");
2965 my @revlist = map { chomp; $_ } <$fd>;
2966 close $fd;