about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-06-04 08:30:55 +0000
committerEric Wong <e@80x24.org>2019-06-04 10:06:18 +0000
commitbbfa42a9ea55b7057c7a6b632f090763c9e7c655 (patch)
tree241795973e799c5b54e04e3d7f20a9e2948fea6b
parentb5693a2107a1edd02cfad73f9302833e1b91d339 (diff)
downloadpublic-inbox-bbfa42a9ea55b7057c7a6b632f090763c9e7c655.tar.gz
git would not generate non-ASCII digits to describe
hunk offsets, so don't waste more time than necessary
to make sense of non-ASCII digit chars for line offsets.
-rw-r--r--lib/PublicInbox/SolverGit.pm2
-rw-r--r--lib/PublicInbox/ViewDiff.pm4
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/PublicInbox/SolverGit.pm b/lib/PublicInbox/SolverGit.pm
index 3841c567..81f99025 100644
--- a/lib/PublicInbox/SolverGit.pm
+++ b/lib/PublicInbox/SolverGit.pm
@@ -206,7 +206,7 @@ sub find_extract_diff ($$$) {
         }
 
         my $msgs = $srch->query($q, { relevance => 1 });
-        my $re = qr/\Aindex ($pre[a-f0-9]*)\.\.($post[a-f0-9]*)(?: (\d+))?/;
+        my $re = qr/\Aindex ($pre[a-f0-9]*)\.\.($post[a-f0-9]*)(?: ([0-9]+))?/;
 
         my $di;
         foreach my $smsg (@$msgs) {
diff --git a/lib/PublicInbox/ViewDiff.pm b/lib/PublicInbox/ViewDiff.pm
index 411ed2bb..b7dab819 100644
--- a/lib/PublicInbox/ViewDiff.pm
+++ b/lib/PublicInbox/ViewDiff.pm
@@ -55,12 +55,12 @@ sub diff_hunk ($$$$) {
         (defined($spfx) && defined($oid_a) && defined($oid_b)) or
                 return "@@ $ca $cb @@";
 
-        my ($n) = ($ca =~ /^-(\d+)/);
+        my ($n) = ($ca =~ /^-([0-9]+)/);
         $n = defined($n) ? do { ++$n; "#n$n" } : '';
 
         my $rv = qq(@@ <a\nhref="$spfx$oid_a/s/$dctx->{Q}$n">$ca</a>);
 
-        ($n) = ($cb =~ /^\+(\d+)/);
+        ($n) = ($cb =~ /^\+([0-9]+)/);
         $n = defined($n) ? do { ++$n; "#n$n" } : '';
 
         $rv .= qq( <a\nhref="$spfx$oid_b/s/$dctx->{Q}$n">$cb</a> @@);