From 6158b3e3476cd49a2e6c32fad88a7905ec88de8f Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 22 Feb 2017 03:01:24 +0000 Subject: repobrowse: fixup revision handling Revisions passed in the URL must not be ignored. This fixes some bugs introduced in commit f6244586ba4f5a5e7575e1254be8c9bbe303fce9 ("repobrowse: switch to new URL format to avoid query strings") --- lib/PublicInbox/RepoGitLog.pm | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'lib/PublicInbox/RepoGitLog.pm') diff --git a/lib/PublicInbox/RepoGitLog.pm b/lib/PublicInbox/RepoGitLog.pm index 38097ed3..1ad83fc0 100644 --- a/lib/PublicInbox/RepoGitLog.pm +++ b/lib/PublicInbox/RepoGitLog.pm @@ -124,22 +124,16 @@ sub call_git_log { my ($self, $req) = @_; my $repo = $req->{-repo}; my $max = $repo->{max_commit_count} || 50; - my $h = $req->{h}; + my $tip = $req->{tip} || $repo->tip; + $req->{lpfx} = $req->{relcmd}; $max = int($max); $max = 50 if $max == 0; my $env = $req->{env}; my $git = $repo->{git}; - my $tip = $req->{-repo}->tip; my $cmd = $git->cmd(qw(log --no-notes --no-color --no-abbrev), $LOG_FMT, "-$max", $tip, '--'); my $rdr = { 2 => $git->err_begin }; - my $title = "log: $repo->{repo}"; - if (defined $h) { - $title .= ' ('. utf8_html($h). ')'; - $req->{lpfx} = $req->{relcmd}; - } else { - $req->{lpfx} = $req->{relcmd} . $tip; - } + my $title = 'log: '.$repo->{repo}.' ('.utf8_html($tip).')'; $req->{lhtml} = $self->html_start($req, $title) . "\n\n"; my $qsp = PublicInbox::Qspawn->new($cmd, undef, $rdr); $qsp->psgi_return($env, undef, sub { -- cgit v1.2.3-24-ge0c7