about summary refs log tree commit homepage
path: root/lib/PublicInbox
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-11-28 05:32:02 +0000
committerEric Wong <e@80x24.org>2022-11-28 23:38:57 +0000
commit0b6098f90d269a57e04ba1c1d587891acdad4e3f (patch)
tree82bd630f149135945430f994f1efb02acc8ac4d2 /lib/PublicInbox
parentd28167f0a78a2010a752bdc16b3b8a62e8fc91ae (diff)
downloadpublic-inbox-0b6098f90d269a57e04ba1c1d587891acdad4e3f.tar.gz
We need to ensure `git update-ref --stdin' is complete
before running `git pack-refs', otherwise loose refs can
remain while update-ref is still running.
Diffstat (limited to 'lib/PublicInbox')
-rw-r--r--lib/PublicInbox/LeiMirror.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/PublicInbox/LeiMirror.pm b/lib/PublicInbox/LeiMirror.pm
index 04d9494c..4464b6b1 100644
--- a/lib/PublicInbox/LeiMirror.pm
+++ b/lib/PublicInbox/LeiMirror.pm
@@ -315,7 +315,12 @@ sub fgrp_update {
                 upr($lei, $w, 'create', $ref, $oid);
         }
         close($w) or warn "E: close(update-ref --stdin): $! (need git 1.8.5+)\n";
-        $LIVE->{$pid} = [ \&reap_cmd, $fgrp, $cmd ];
+        my $pack = PublicInbox::OnDestroy->new($$, \&pack_dst, $fgrp);
+        $LIVE->{$pid} = [ \&reap_cmd, $fgrp, $cmd, $pack ];
+}
+
+sub pack_dst { # packs lightweight satellite repos
+        my ($fgrp) = @_;
         pack_refs($fgrp, $fgrp->{cur_dst});
 }