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-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 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 92C9F1FB0E for ; Sun, 28 Mar 2021 09:01:25 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 05/12] lei blob: fail early if no git dirs Date: Sun, 28 Mar 2021 09:01:17 +0000 Message-Id: <20210328090124.3541-6-e@80x24.org> In-Reply-To: <20210328090124.3541-1-e@80x24.org> References: <20210328090124.3541-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: This avoids triggering a "BUG:" message in the solver code. --- lib/PublicInbox/LeiBlob.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/PublicInbox/LeiBlob.pm b/lib/PublicInbox/LeiBlob.pm index 4bd86253..f44d8af1 100644 --- a/lib/PublicInbox/LeiBlob.pm +++ b/lib/PublicInbox/LeiBlob.pm @@ -103,6 +103,7 @@ sub lei_blob { my $cgd = get_git_dir('.'); unshift(@$git_dirs, $cgd) if defined $cgd; } + return $lei->fail('no --git-dir to try') unless @$git_dirs; my $lxs = $lei->lxs_prepare or return; require PublicInbox::SolverGit; my $self = bless { lxs => $lxs, oid_b => $blob }, __PACKAGE__;