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/RepoGitDiffCommon.pm | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/PublicInbox/RepoGitDiffCommon.pm') diff --git a/lib/PublicInbox/RepoGitDiffCommon.pm b/lib/PublicInbox/RepoGitDiffCommon.pm index 3e3ea4ee..67adca68 100644 --- a/lib/PublicInbox/RepoGitDiffCommon.pm +++ b/lib/PublicInbox/RepoGitDiffCommon.pm @@ -162,6 +162,7 @@ sub DSTATE_LINES () { 2 } sub git_diff_sed_init ($) { my ($req) = @_; $req->{dbuf} = ''; + $req->{-tip} = $req->{-repo}->tip; $req->{ndiff} = $req->{nchg} = $req->{nadd} = $req->{ndel} = 0; $req->{dstate} = DSTATE_INIT; } -- cgit v1.2.3-24-ge0c7