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 13EBF1F453 for ; Wed, 30 Jan 2019 04:44:33 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 10/11] solvergit: extract mode from diff headers properly Date: Wed, 30 Jan 2019 04:44:29 +0000 Message-Id: <20190130044430.28189-11-e@80x24.org> In-Reply-To: <20190130044430.28189-1-e@80x24.org> References: <20190130044430.28189-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: grep() won't set $1, so use "=~", instead. --- lib/PublicInbox/SolverGit.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/PublicInbox/SolverGit.pm b/lib/PublicInbox/SolverGit.pm index 1b1951b..d9b312c 100644 --- a/lib/PublicInbox/SolverGit.pm +++ b/lib/PublicInbox/SolverGit.pm @@ -286,7 +286,8 @@ EOF sub extract_old_mode ($) { my ($di) = @_; - if (grep(/\Aold mode (100644|100755|120000)$/, @{$di->{hdr_lines}})) { + if (join('', @{$di->{hdr_lines}}) =~ + /^old mode (100644|100755|120000)\b/) { return $1; } '100644'; -- EW