From: Eric Wong Date: Sun, 20 Jan 2019 12:16:47 +0000 (+0000) Subject: viewdiff: do not link to 0{7,40} blobs (again) X-Git-Tag: v1.2.0~397^2~37 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=24d67d4f20decf06e73764ac53b68d16f06c8f12;p=public-inbox.git 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-zeroes object_ids as the post-image correctly. --- 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;