diff options
author | Eric Wong <e@80x24.org> | 2017-02-16 20:53:42 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2017-02-16 20:53:42 +0000 |
commit | 1f34241e5dc94417d49e2c728e0f2ea04ddc39b0 (patch) | |
tree | 95b1944b3aeec0d34d3ee6d63b652fc51077b953 /lib/PublicInbox/RepoGitSnapshot.pm | |
parent | f99f1c9f53c9d746f7223b457e386dbb20b57c07 (diff) | |
download | public-inbox-1f34241e5dc94417d49e2c728e0f2ea04ddc39b0.tar.gz |
This makes it more consistent with how we use the Inbox objects for the main code.
Diffstat (limited to 'lib/PublicInbox/RepoGitSnapshot.pm')
-rw-r--r-- | lib/PublicInbox/RepoGitSnapshot.pm | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/PublicInbox/RepoGitSnapshot.pm b/lib/PublicInbox/RepoGitSnapshot.pm index 9ba4c04a..44a6bd59 100644 --- a/lib/PublicInbox/RepoGitSnapshot.pm +++ b/lib/PublicInbox/RepoGitSnapshot.pm @@ -45,24 +45,24 @@ sub call_git_snapshot ($$) { # invoked by PublicInbox::RepoBase::call return $self->r(404) unless ($ref =~ s/\.($SUFFIX)\z//o); my $fmt = $1; my $env = $req->{env}; - my $repo_info = $req->{repo_info}; + my $repo = $req->{-repo}; # support disabling certain snapshots types entirely to twart # URL guessing since it could burn server resources. - return $self->r(404) if $repo_info->{snapshots_disabled}->{$fmt}; + return $self->r(404) if $repo->{snapshots_disabled}->{$fmt}; # strip optional basename (may not exist) - $ref =~ s/$repo_info->{snapshot_re}//; + $ref =~ s/$repo->{snapshot_re}//; # don't allow option/command injection, git refs do not start with '-' return $self->r(404) if $ref =~ /\A-/; - my $git = $repo_info->{git}; + my $git = $repo->{git}; my $tree = ''; my $last_cb = sub { delete $env->{'repobrowse.tree_cb'}; delete $env->{'qspawn.quiet'}; - my $pfx = "$repo_info->{snapshot_pfx}-$ref/"; + my $pfx = "$repo->{snapshot_pfx}-$ref/"; my $cmd = $git->cmd('archive', "--prefix=$pfx", "--format=$fmt", $tree); my $rdr = { 2 => $git->err_begin }; |