expath is always defined, even to an empty string,
so simplify the conditional for checking it.
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;
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;