sysseek($in, 0, 0) or die "seek: $!";
dbg($self, 'preparing index');
- my $rdr = { 0 => fileno($in), -hold => $in };
+ my $rdr = { 0 => $in };
my $cmd = [ qw(git update-index -z --index-info) ];
my $qsp = PublicInbox::Qspawn->new($cmd, $self->{git_env}, $rdr);
$path_a = git_quote($path_a);
if ($nxt && oids_same_ish($nxt->{oid_b}, $di->{oid_b})) {
dbg($self, $msg);
dbg($self, 'trying '.di_url($self, $nxt));
+ return do_git_apply($self);
} else {
ERR($self, $msg);
}
my $patches = $self->{patches};
# we need --ignore-whitespace because some patches are CRLF
- my @cmd = (qw(git -C), $dn, qw(apply --cached --ignore-whitespace
+ my @cmd = (qw(git apply --cached --ignore-whitespace
--unidiff-zero --whitespace=warn --verbose));
my $len = length(join(' ', @cmd));
my $total = $self->{tot};
} while (@$patches && $len < $ARG_SIZE_MAX &&
!oids_same_ish($patches->[0]->{oid_b}, $prv_oid_b));
- my $rdr = { 2 => 1 };
- my $qsp = PublicInbox::Qspawn->new(\@cmd, $self->{git_env}, $rdr);
+ my $opt = { 2 => 1, -C => $dn };
+ my $qsp = PublicInbox::Qspawn->new(\@cmd, $self->{git_env}, $opt);
$self->{-cur_di} = $di;
$self->{-qsp} = $qsp;
$qsp->psgi_qx($self->{psgi_env}, undef, \&apply_result, $self);