From 26031fa99b0d32db78f3ae77eaf480c03f7cfaac Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 20 Jan 2019 12:16:47 +0000 Subject: viewdiff: do not link to 0{7,40} blobs (again) We must reset diff context when starting a new file; and we must check for all-zeroe 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 45d28e37..a8045687 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; -- cgit v1.2.3-24-ge0c7