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.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, T_SCC_BODY_TEXT_LINE 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 E2A8A1F601 for ; Fri, 2 Sep 2022 18:25:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1662143138; bh=84+5sbudktzcSOLKs3uMdm2usb7GbHX4ailmSpzbVYw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=FuE11QfG4+v3Z9mYVOpLA6Gqu/O1nZwl9UkPLk+UYXTPwJEve8ZD/DJTTtP5z+8Ds F9onfm/fBpCVG5i1man/ZU7GsreJXXWGqO7Q2DVV3I3OY+q+zX/BzjvUUpDom4lg+T uM49T5oQ65GP1+Y4liSr6/Lqt1Fpb9Nb5+OAWZ6E= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 1/2] lei/store: do not write info/refs file Date: Fri, 2 Sep 2022 18:26:22 +0000 Message-Id: <20220902182624.8276-2-e@80x24.org> In-Reply-To: <20220902182624.8276-1-e@80x24.org> References: <20220902182624.8276-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: That file is meant for dumb HTTP servers, so avoid wasting two inodes on something that should never be served for private email. --- lib/PublicInbox/Import.pm | 2 +- t/lei_store.t | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/Import.pm b/lib/PublicInbox/Import.pm index aef49033..2c8f310a 100644 --- a/lib/PublicInbox/Import.pm +++ b/lib/PublicInbox/Import.pm @@ -182,8 +182,8 @@ sub _update_git_info ($$) { my $env = { GIT_INDEX_FILE => $index }; run_die([@cmd, qw(read-tree -m -v -i), $self->{ref}], $env); } - eval { run_die([@cmd, 'update-server-info']) }; my $ibx = $self->{ibx}; + eval { run_die([@cmd, 'update-server-info']) } if $ibx; if ($ibx && $ibx->version == 1 && -d "$ibx->{inboxdir}/public-inbox" && eval { require PublicInbox::SearchIdx }) { eval { diff --git a/t/lei_store.t b/t/lei_store.t index 40ad7800..5a5e5de0 100644 --- a/t/lei_store.t +++ b/t/lei_store.t @@ -1,5 +1,5 @@ #!perl -w -# Copyright (C) 2020-2021 all contributors +# Copyright (C) all contributors # License: AGPL-3.0+ use strict; use v5.10.1; @@ -149,4 +149,7 @@ EOM is($mset->size, 1, 'rt:1.hour.ago.. works w/ local time'); } +is_deeply([glob("$store_dir/local/*.git/info/refs")], [], + 'no info/refs in private lei/store'); + done_testing;