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.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 DFD6720383 for ; Wed, 22 May 2019 02:14:03 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 3/5] git: workaround old git-rev-parse(1) (--git-path) Date: Wed, 22 May 2019 02:14:00 +0000 Message-Id: <20190522021402.24114-4-e@80x24.org> In-Reply-To: <20190522021402.24114-1-e@80x24.org> References: <20190522021402.24114-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: git < 2.5.0 was missing --git-path support. This means any users relying on some rare environment variables will need git 2.5.0+ --- lib/PublicInbox/Git.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm index 236f70c..a4daaa4 100644 --- a/lib/PublicInbox/Git.pm +++ b/lib/PublicInbox/Git.pm @@ -59,6 +59,11 @@ sub git_path ($$) { $self->{-git_path}->{$path} ||= do { local $/ = "\n"; chomp(my $str = $self->qx(qw(rev-parse --git-path), $path)); + + # git prior to 2.5.0 did not understand --git-path + if ($str eq "--git-path\n$path") { + $str = "$self->{git_dir}/$path"; + } $str; }; } -- EW