]> Sergey Matveev's repositories - public-inbox.git/commitdiff
v2writable: pass oid to uindex_oid
authorEric Wong <e@80x24.org>
Tue, 27 Oct 2020 07:54:34 +0000 (07:54 +0000)
committerEric Wong <e@80x24.org>
Sat, 7 Nov 2020 10:21:47 +0000 (10:21 +0000)
We'll be validating against this in the future to stop
bugs from creeping in.

lib/PublicInbox/V2Writable.pm

index c8b01a3da858920f5492c647deb5c3c4cbbb2a59..efda79074de1fd563c5cd81e086a45e199f7d5f5 100644 (file)
@@ -1073,12 +1073,12 @@ sub sync_prepare ($$) {
        # our code and blindly injects "d" file history into git repos
        if (my @leftovers = keys %{delete($sync->{D}) // {}}) {
                warn('W: unindexing '.scalar(@leftovers)." leftovers\n");
-               my $arg = { self => $self };
                my $unindex_oid = $self->can('unindex_oid');
                for my $oid (@leftovers) {
                        $oid = unpack('H*', $oid);
                        $self->{current_info} = "leftover $oid";
-                       $self->git->cat_async($oid, $unindex_oid, $arg);
+                       my $req = { %$sync, oid => $oid };
+                       $self->git->cat_async($oid, $unindex_oid, $req);
                }
                $self->git->cat_async_wait;
        }
@@ -1151,7 +1151,7 @@ sub unindex_todo ($$$) {
        my $unindex_oid = $self->can('unindex_oid');
        while (<$fh>) {
                /\A:\d{6} 100644 $OID ($OID) [AM]\tm$/o or next;
-               $self->git->cat_async($1, $unindex_oid, $sync);
+               $self->git->cat_async($1, $unindex_oid, { %$sync, oid => $1 });
        }
        close $fh or die "git log failed: \$?=$?";
        $self->git->cat_async_wait;