From e7dc3224ad0b497da6ef242e3a9c612c5702514e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 16 Feb 2017 23:26:01 +0000 Subject: repobrowse: memoize git symbolic-ref resolution The "HEAD" symbolic ref is rarely changed, so memoize it for now and avoid exposing it in URLs. --- lib/PublicInbox/RepoGitCommit.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/PublicInbox/RepoGitCommit.pm') diff --git a/lib/PublicInbox/RepoGitCommit.pm b/lib/PublicInbox/RepoGitCommit.pm index 21f450ea..1a10b13c 100644 --- a/lib/PublicInbox/RepoGitCommit.pm +++ b/lib/PublicInbox/RepoGitCommit.pm @@ -117,7 +117,6 @@ sub git_commit_sed ($$) { sub call_git_commit { # RepoBase calls this my ($self, $req) = @_; my $env = $req->{env}; - my $tip = $req->{-tip}; my $expath = $req->{expath}; if ($expath ne '') { @@ -128,7 +127,7 @@ sub call_git_commit { # RepoBase calls this my $git = $req->{-repo}->{git}; my $cmd = $git->cmd(qw(show -z --numstat -p --encoding=UTF-8 --no-notes --no-color -c), - $git->abbrev, GIT_FMT, $tip, '--'); + $git->abbrev, GIT_FMT, $req->{-repo}->tip, '--'); my $rdr = { 2 => $git->err_begin }; my $qsp = PublicInbox::Qspawn->new($cmd, undef, $rdr); $env->{'qspawn.quiet'} = 1; -- cgit v1.2.3-24-ge0c7