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/RepoGitSnapshot.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/PublicInbox/RepoGitSnapshot.pm') diff --git a/lib/PublicInbox/RepoGitSnapshot.pm b/lib/PublicInbox/RepoGitSnapshot.pm index 44a6bd59..3d53fa6d 100644 --- a/lib/PublicInbox/RepoGitSnapshot.pm +++ b/lib/PublicInbox/RepoGitSnapshot.pm @@ -36,7 +36,7 @@ our %FMT_TYPES = ( sub call_git_snapshot ($$) { # invoked by PublicInbox::RepoBase::call my ($self, $req) = @_; - my $ref = $req->{-tip}; + my $ref = $req->{h} || $req->{-repo}->tip; my $orig_fn = $ref; # just in case git changes refname rules, don't allow wonky filenames -- cgit v1.2.3-24-ge0c7