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 2942E21437 for ; Mon, 21 Jan 2019 20:53:00 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 29/37] viewdiff: do not link to 0{7,40} blobs (again) Date: Mon, 21 Jan 2019 20:52:45 +0000 Message-Id: <20190121205253.10455-30-e@80x24.org> In-Reply-To: <20190121205253.10455-1-e@80x24.org> References: <20190121205253.10455-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: We must reset diff context when starting a new file; and we must check for all-zeroes object_ids as the post-image correctly. --- lib/PublicInbox/ViewDiff.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/PublicInbox/ViewDiff.pm b/lib/PublicInbox/ViewDiff.pm index 45d28e3..a804568 100644 --- a/lib/PublicInbox/ViewDiff.pm +++ b/lib/PublicInbox/ViewDiff.pm @@ -107,9 +107,11 @@ sub flush_diff ($$$$) { $$dst .= to_html($linkify, $s); } elsif ($s =~ s/^(index $OID_NULL\.\.)($OID_BLOB)\b//o) { $$dst .= $1 . oid($dctx, $spfx, $2); + $dctx = { Q => '' }; $$dst .= to_html($linkify, $s) ; - } elsif ($s =~ s/^index ($OID_NULL)(\.\.$OID_BLOB)\b//o) { + } elsif ($s =~ s/^index ($OID_BLOB)(\.\.$OID_NULL)\b//o) { $$dst .= 'index ' . oid($dctx, $spfx, $1) . $2; + $dctx = { Q => '' }; $$dst .= to_html($linkify, $s); } elsif ($s =~ /^index ($OID_BLOB)\.\.($OID_BLOB)/o) { $dctx->{oid_a} = $1; -- EW