about summary refs log tree commit homepage
path: root/lib/PublicInbox/ViewDiff.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-09-10 08:17:20 +0000
committerEric Wong <e@80x24.org>2022-09-10 19:50:49 +0000
commitfd541d0488980f649fe615d3c2fc10578a33e339 (patch)
tree13e9ff551305029cad2f8c359bc06e9952a9b842 /lib/PublicInbox/ViewDiff.pm
parentab9c03ff4aa369b397dc1a8c8936153c8565fd05 (diff)
downloadpublic-inbox-fd541d0488980f649fe615d3c2fc10578a33e339.tar.gz
/(.*?)\z/ will capture the "$X insertions(+), $Y deletions(-)"
bit anyways, along with whatever extra notes before the
/^diff --git / line.  So just rely on /(.*?)\z/ and avoid
the special case before it.
Diffstat (limited to 'lib/PublicInbox/ViewDiff.pm')
-rw-r--r--lib/PublicInbox/ViewDiff.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/PublicInbox/ViewDiff.pm b/lib/PublicInbox/ViewDiff.pm
index 5d23881b..b9115669 100644
--- a/lib/PublicInbox/ViewDiff.pm
+++ b/lib/PublicInbox/ViewDiff.pm
@@ -162,9 +162,9 @@ sub diff_before_or_after ($$) {
         if (exists $ctx->{-anchors} && $$x =~ /\A(.*?) # likely "---\n" # \$1
                         # diffstat lines:
                         ((?:^\x20(?:[^\n]+?)(?:\x20+\|\x20[^\n]*\n))+)
-                        (\x20[0-9]+\x20files?\x20)changed,([^\n]+\n)
+                        (\x20[0-9]+\x20files?\x20)changed,
                         (.*?)\z/msx) { # notes, commit message, etc
-                my @x = ($5, $4, $3, $2, $1);
+                my @x = ($4, $3, $2, $1);
                 undef $$x;
                 my $lnk = $ctx->{-linkify};
                 my $zfh = $ctx->{zfh};
@@ -177,8 +177,8 @@ sub diff_before_or_after ($$) {
                 my $ch = $ctx->{changed_href} // '#related';
                 print $zfh pop(@x), # $3 /^ \d+ files? /
                         qq(<a href="$ch">changed</a>,),
-                        ascii_html(pop @x), # insertions/deletions
-                        $lnk->to_html(@x); # notes, commit message, etc
+                        # insertions/deletions, notes, commit message, etc:
+                        $lnk->to_html(@x);
         } else {
                 print { $ctx->{zfh} } $ctx->{-linkify}->to_html($$x);
         }