about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2017-01-13 22:53:20 +0000
committerEric Wong <e@80x24.org>2017-01-13 22:53:20 +0000
commitb3623ed3c06aa4ac2e47378d3c948c35a6809efa (patch)
tree99065bb1d7a038be58f0cb5452ecfe28ff60c9dc
parent26fdf73fb6b25583d8b4bc6a75d79a5ef7d88318 (diff)
downloadpublic-inbox-b3623ed3c06aa4ac2e47378d3c948c35a6809efa.tar.gz
expath is always defined, even to an empty string,
so simplify the conditional for checking it.
-rw-r--r--lib/PublicInbox/RepobrowseGitBlob.pm4
-rw-r--r--lib/PublicInbox/RepobrowseGitPlain.pm7
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;