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 5253D1F463; Thu, 2 Jan 2020 21:12:20 +0000 (UTC) Date: Thu, 2 Jan 2020 21:12:20 +0000 From: Eric Wong To: meta@public-inbox.org Subject: Re: [PATCH 2/3] solver: extract_diff: deal with missing "diff --git" line Message-ID: <20200102211220.GA16996@dcvr> References: <20200102092459.17612-1-e@80x24.org> <20200102092459.17612-3-e@80x24.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200102092459.17612-3-e@80x24.org> List-Id: Eric Wong wrote: > sub extract_diff ($$) { > + # old mode $4 > + (?:^old mode\x20(100644|120000|100755)$LF)? > + $di->{oid_a} = $6; > + $di->{oid_b} = $7; > + $di->{mode_a} = $5 // $8 // $6; # new (file) // unchanged // old $6 is totally wrong, since it's already {oid_a} diff --git a/lib/PublicInbox/SolverGit.pm b/lib/PublicInbox/SolverGit.pm index ef76d706..7c367895 100644 --- a/lib/PublicInbox/SolverGit.pm +++ b/lib/PublicInbox/SolverGit.pm @@ -161,7 +161,7 @@ sub extract_diff ($$) { my $path_b = $3 // $11; $di->{oid_a} = $6; $di->{oid_b} = $7; - $di->{mode_a} = $5 // $8 // $6; # new (file) // unchanged // old + $di->{mode_a} = $5 // $8 // $4; # new (file) // unchanged // old my $patch = $9; # don't care for leading 'a/' and 'b/'