diff options
author | Eric Wong <e@80x24.org> | 2017-01-13 22:53:20 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2017-01-13 22:53:20 +0000 |
commit | b3623ed3c06aa4ac2e47378d3c948c35a6809efa (patch) | |
tree | 99065bb1d7a038be58f0cb5452ecfe28ff60c9dc /lib | |
parent | 26fdf73fb6b25583d8b4bc6a75d79a5ef7d88318 (diff) | |
download | public-inbox-b3623ed3c06aa4ac2e47378d3c948c35a6809efa.tar.gz |
expath is always defined, even to an empty string, so simplify the conditional for checking it.
Diffstat (limited to 'lib')
-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; |