my ($res) = @_;
my $to_read = 8192;
eval {
- my $fh = $res->([ 200, ['Content-Length' => $size,
- 'Content-Type' => $type]]);
+ my $fh = $res->([ 200, ['Content-Length', $size,
+ 'Content-Type', $type]]);
$fh->write($buf) if defined $buf;
while ($left > 0) {
$to_read = $left if $to_read > $left;
use PublicInbox::RepoGitDiffCommon;
use PublicInbox::Qspawn;
-use constant GIT_FMT => '--pretty=format:'.join('%n',
- '%H', '%h', '%s', '%an <%ae>', '%ai', '%cn <%ce>', '%ci',
- '%t', '%p', '%D', '%b%x00');
-
-use constant CC_EMPTY => " This is a merge, and the combined diff is empty.\n";
-use constant CC_MERGE => " This is a merge, showing combined diff:\n\n";
+use constant {
+ GIT_FMT => '--pretty=format:'.join('%n',
+ '%H', '%h', '%s', '%an <%ae>', '%ai', '%cn <%ce>', '%ci',
+ '%t', '%p', '%D', '%b%x00'),
+ CC_EMPTY => " This is a merge, and the combined diff is empty.\n",
+ CC_MERGE => " This is a merge, showing combined diff:\n\n"
+};
sub commit_header {
my ($self, $req) = @_;
$x .= "<a\nhref=\"$pfx\">$try the latest commit in HEAD</a>\n";
$x .= '</pre></body>';
- [404, ['Content-Type'=>'text/html'], [ $x ]];
+ [404, ['Content-Type', 'text/html'], [ $x ]];
}
# FIXME: horrifically expensive...
my $refs = $git->popen(qw(for-each-ref --sort=-creatordate),
EACH_REF_FMT, "--count=$count",
qw(refs/heads/ refs/tags/));
- $fh = $res->([200, ['Content-Type'=>'text/html; charset=UTF-8']]);
+ $fh = $res->([200, ['Content-Type', 'text/html; charset=UTF-8']]);
# ref names are unpredictable in length and requires tables :<
$fh->write($self->html_start($req,
"$repo->{repo}: overview") .
}
my $url = $base . $uri . $qs;
[ 301,
- [ Location => $url, 'Content-Type' => 'text/plain' ],
+ [ 'Location', $url, 'Content-Type', 'text/plain' ],
[ "Redirecting to $url\n" ] ]
}