]> Sergey Matveev's repositories - public-inbox.git/commitdiff
solver: note the synchronous nature of index preparation
authorEric Wong <e@80x24.org>
Sat, 19 Jan 2019 08:13:11 +0000 (08:13 +0000)
committerEric Wong <e@80x24.org>
Sun, 20 Jan 2019 04:24:54 +0000 (04:24 +0000)
It's not likely to be worth our time to support
a callback-driven model for something which happens
once per patch series.

lib/PublicInbox/SolverGit.pm

index 51be2cdf91f0d6fed4e41f8b11dc7c3eda2cdc48..42bb6033176b97cf513abf1c2e6132129a29f8e7 100644 (file)
@@ -221,11 +221,13 @@ sub prepare_index ($$$$) {
        my ($r, $w);
        my $path_a = $di->{path_a} or die "BUG: path_a missing for $oid_full";
        my $mode_a = $di->{mode_a} || extract_old_mode($di);
-       my @git = (qw(git -C), $wt_dir);
 
+       # unlike git-apply(1), this only gets called once in a patch
+       # series and happens too quickly to be worth making async:
        pipe($r, $w) or die "pipe: $!";
        my $rdr = { 0 => fileno($r) };
-       my $pid = spawn([@git, qw(update-index -z --index-info)], {}, $rdr);
+       my $pid = spawn([qw(git -C), $wt_dir,
+                        qw(update-index -z --index-info)], undef, $rdr);
        close $r or die "close pipe(r): $!";
        print $w "$mode_a $oid_full\t$path_a\0" or die "print update-index: $!";