From f6244586ba4f5a5e7575e1254be8c9bbe303fce9 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 15 Feb 2017 22:35:18 +0000 Subject: repobrowse: switch to new URL format to avoid query strings Query strings make endpoint caching more difficult since they're order-independent. They are also more likely lost or truncated inadvertantly when copy+pasting, so try to avoid them for default endpoints. There's still some things which are broken and followup commits will be needed to fix them. --- lib/PublicInbox/RepoGitPatch.pm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lib/PublicInbox/RepoGitPatch.pm') diff --git a/lib/PublicInbox/RepoGitPatch.pm b/lib/PublicInbox/RepoGitPatch.pm index e9227b6f..d851457c 100644 --- a/lib/PublicInbox/RepoGitPatch.pm +++ b/lib/PublicInbox/RepoGitPatch.pm @@ -17,13 +17,12 @@ sub call_git_patch { my ($self, $req) = @_; my $git = $req->{repo_info}->{git}; my $env = $req->{env}; - my $q = PublicInbox::RepoGitQuery->new($env); - my $id = $q->{id}; - $id =~ /\A[\w-]+([~\^][~\^\d])*\z/ or $id = 'HEAD'; + my $tip = $req->{-tip}; + $tip =~ /\A[\w-]+([~\^][~\^\d])*\z/; # limit scope, don't take extra args to avoid wasting server # resources buffering: - my $range = "$id~1..$id^0"; + my $range = "$tip~1..$tip^0"; my $cmd = $git->cmd(@CMD, $sig." $range", $range, '--'); my $expath = $req->{expath}; push @$cmd, $expath if $expath ne ''; -- cgit v1.2.3-24-ge0c7