about summary refs log tree commit homepage
path: root/lib/PublicInbox/RepoGitTree.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2017-02-22 03:01:24 +0000
committerEric Wong <e@80x24.org>2017-02-22 03:01:24 +0000
commit6158b3e3476cd49a2e6c32fad88a7905ec88de8f (patch)
tree04eaf4f795bb393167cb8c32d37963c3e1e5c4b4 /lib/PublicInbox/RepoGitTree.pm
parenta49c12485985cce469c8b653ff7b76c85343b08d (diff)
downloadpublic-inbox-6158b3e3476cd49a2e6c32fad88a7905ec88de8f.tar.gz
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")
Diffstat (limited to 'lib/PublicInbox/RepoGitTree.pm')
-rw-r--r--lib/PublicInbox/RepoGitTree.pm9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/PublicInbox/RepoGitTree.pm b/lib/PublicInbox/RepoGitTree.pm
index 5e880ee3..64ab9e6f 100644
--- a/lib/PublicInbox/RepoGitTree.pm
+++ b/lib/PublicInbox/RepoGitTree.pm
@@ -22,7 +22,7 @@ sub call_git_tree {
         my @extra = @{$req->{extra}};
         my $repo = $req->{-repo};
         my $git = $repo->{git};
-        my $tip = $repo->tip;
+        my $tip = $req->{tip} || $repo->tip;
         my $obj = "$tip:$req->{expath}";
         my ($hex, $type, $size) = $git->check($obj);
 
@@ -31,8 +31,7 @@ sub call_git_tree {
         }
 
         my $opts = { nofollow => 1 };
-        my $title = $req->{expath};
-        $title = $title eq '' ? 'tree' : utf8_html($title);
+        my $title = "tree: ".utf8_html($req->{expath});
         if ($type eq 'tree') {
                 $opts->{noindex} = 1;
                 $req->{thtml} = $self->html_start($req, $title, $opts) . "\n";
@@ -193,8 +192,8 @@ sub git_tree_show {
         $req->{thtml} .= "\npath: $t\n\n<b>mode\tsize\tname</b>\n";
         if (defined(my $last = $req->{extra}->[-1])) {
                 $pfx = PublicInbox::Hval->utf8($last)->as_path;
-        } elsif (defined $req->{h}) {
-                $pfx = $req->{-repo}->tip;
+        } elsif (defined(my $tip = $req->{tip})) {
+                $pfx = $tip;
         } else {
                 $pfx = 'tree/' . $req->{-repo}->tip;
         }