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/RepoGitPatch.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/PublicInbox/RepoGitPatch.pm') diff --git a/lib/PublicInbox/RepoGitPatch.pm b/lib/PublicInbox/RepoGitPatch.pm index e1431f39..3e4eabe9 100644 --- a/lib/PublicInbox/RepoGitPatch.pm +++ b/lib/PublicInbox/RepoGitPatch.pm @@ -15,9 +15,10 @@ my $sig = '--signature=git '.join(' ', @CMD); sub call_git_patch { my ($self, $req) = @_; - my $git = $req->{-repo}->{git}; + my $repo = $req->{-repo}; + my $git = $repo->{git}; my $env = $req->{env}; - my $tip = $req->{-tip}; + my $tip = $repo->tip; $tip =~ /\A[\w-]+([~\^][~\^\d])*\z/; # limit scope, don't take extra args to avoid wasting server -- cgit v1.2.3-24-ge0c7