From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.1 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 6B0AA203B4 for ; Mon, 28 Nov 2022 05:32:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1669613566; bh=lD3rl5Rl2z50fdKEWEtsQ6r7W+uKvBXAT0KcWEr7Elw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=gGJGF/bwrQBqUUqOn/D8njNQe6wUrVLLKcXf7EArot95T+9oLQb/fmUYN4pMUcE/4 wnTMk6sPFjNdnr5aEbROe7PpRUv9+XPaGtOCdhtmExcq5w1qPKaWR7iIoWwuNb86GJ 3g3PWSxoJNWKDF/SWlZNuQ5jvgb51fNeN/TIFAIs= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 65/95] lei_mirror: properly pack-refs in non-forkgroup repos Date: Mon, 28 Nov 2022 05:32:02 +0000 Message-Id: <20221128053232.291618-66-e@80x24.org> In-Reply-To: <20221128053232.291618-1-e@80x24.org> References: <20221128053232.291618-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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. --- lib/PublicInbox/LeiMirror.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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}); }