No point in forcing users to pass a hashref/object to get a single git directory. --- lib/PublicInbox/GitHTTPBackend.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/PublicInbox/GitHTTPBackend.pm b/lib/PublicInbox/GitHTTPBackend.pm index 7267a1d..4f58c6b 100644 --- a/lib/PublicInbox/GitHTTPBackend.pm +++ b/lib/PublicInbox/GitHTTPBackend.pm @@ -80,7 +80,7 @@ sub serve_dumb { return r(404); } - my $f = "$git->{git_dir}/$path"; + my $f = (ref $git ? $git->{git_dir} : $git) . '/' . $path; return r(404) unless -f $f && -r _; # just in case it's a FIFO :P my @st = stat(_); my $size = $st[7]; @@ -179,7 +179,7 @@ sub serve_smart { my $val = $env->{$name}; $env{$name} = $val if defined $val; } - my $git_dir = $git->{git_dir}; + my $git_dir = ref $git ? $git->{git_dir} : $git; $env{GIT_HTTP_EXPORT_ALL} = '1'; $env{PATH_TRANSLATED} = "$git_dir/$path"; my %rdr = ( 0 => fileno($in) ); -- unsubscribe: meta+unsubscr...@public-inbox.org archive: https://public-inbox.org/meta/