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
--
unsubscribe: [email protected]
archive: https://public-inbox.org/meta/