about summary refs log tree commit homepage
path: root/lib/PublicInbox/SolverGit.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-12-30 05:04:15 +0000
committerEric Wong <e@80x24.org>2019-12-30 17:52:17 +0000
commit30afcadb13f446c99952883bbaa54e102757b682 (patch)
treeb247308fe5c626e23a4e6d97291ca75d6c4ddfc5 /lib/PublicInbox/SolverGit.pm
parent267371b1273b518215939e817e53733584b68af7 (diff)
downloadpublic-inbox-30afcadb13f446c99952883bbaa54e102757b682.tar.gz
This simplifies our admin module a bit and allows solver to be
used with v1 inboxes using git versions prior to v1.8.5 (but
still >= git v1.8.0).
Diffstat (limited to 'lib/PublicInbox/SolverGit.pm')
-rw-r--r--lib/PublicInbox/SolverGit.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/PublicInbox/SolverGit.pm b/lib/PublicInbox/SolverGit.pm
index 03666646..c57fb4c6 100644
--- a/lib/PublicInbox/SolverGit.pm
+++ b/lib/PublicInbox/SolverGit.pm
@@ -472,7 +472,7 @@ sub do_git_apply ($) {
         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};
@@ -491,8 +491,8 @@ sub do_git_apply ($) {
         } 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);