about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-01-20 12:16:47 +0000
committerEric Wong <e@80x24.org>2019-01-20 12:16:47 +0000
commit26031fa99b0d32db78f3ae77eaf480c03f7cfaac (patch)
treec50e0bb6ee2c11f37c1b15a0d7e3384d71dae3aa
parentd4adef2ef649b738e83d065170dad9d84027dd77 (diff)
downloadpublic-inbox-26031fa99b0d32db78f3ae77eaf480c03f7cfaac.tar.gz
We must reset diff context when starting a new file;
and we must check for all-zeroe object_ids as the
post-image correctly.
-rw-r--r--lib/PublicInbox/ViewDiff.pm4
1 files changed, 3 insertions, 1 deletions
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;