diff options
-rw-r--r-- | lib/PublicInbox/RepobrowseGitBlob.pm | 4 | ||||
-rw-r--r-- | lib/PublicInbox/RepobrowseGitPlain.pm | 7 |
2 files changed, 2 insertions, 9 deletions
diff --git a/lib/PublicInbox/RepobrowseGitBlob.pm b/lib/PublicInbox/RepobrowseGitBlob.pm index d38101ed..a11c457c 100644 --- a/lib/PublicInbox/RepobrowseGitBlob.pm +++ b/lib/PublicInbox/RepobrowseGitBlob.pm @@ -15,10 +15,8 @@ sub call_git_blob { my $q = PublicInbox::RepobrowseGitQuery->new($req->{env}); my $id = $q->{id}; $id eq '' and $id = 'HEAD'; + $id .= ":$req->{expath}"; - if (length(my $expath = $req->{expath})) { - $id .= ":$expath"; - } my ($cat, $hex, $type, $size) = $git->cat_file_begin($id); return unless defined $cat; diff --git a/lib/PublicInbox/RepobrowseGitPlain.pm b/lib/PublicInbox/RepobrowseGitPlain.pm index c59993fe..c985173c 100644 --- a/lib/PublicInbox/RepobrowseGitPlain.pm +++ b/lib/PublicInbox/RepobrowseGitPlain.pm @@ -13,12 +13,7 @@ sub call_git_plain { my $q = PublicInbox::RepobrowseGitQuery->new($req->{env}); my $id = $q->{id}; $id eq '' and $id = 'HEAD'; - - if (length(my $expath = $req->{expath})) { - $id .= ":$expath"; - } else { - $id .= ':'; - } + $id .= ":$req->{expath}"; my ($cat, $hex, $type, $size) = $git->cat_file_begin($id); return unless defined $cat; |