]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/ViewDiff.pm
update copyrights for 2021
[public-inbox.git] / lib / PublicInbox / ViewDiff.pm
index 6fe9a0d7610e5a345ede4c74abd362514502ce61..8fe7261ff2909220b7e3e28c6f7f07b97c9e173f 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2019-2020 all contributors <meta@public-inbox.org>
+# Copyright (C) 2019-2021 all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 #
 # used by PublicInbox::View
@@ -18,8 +18,8 @@ use PublicInbox::Git qw(git_unquote);
 
 sub UNSAFE () { "^A-Za-z0-9\-\._~/" }
 
-my $OID_NULL = '0{7,40}';
-my $OID_BLOB = '[a-f0-9]{7,40}';
+my $OID_NULL = '0{7,}';
+my $OID_BLOB = '[a-f0-9]{7,}';
 my $LF = qr!\n!;
 my $ANY = qr![^\n]!;
 my $FN = qr!(?:"?[^/\n]+/[^\n]+|/dev/null)!;
@@ -50,12 +50,12 @@ sub diff_hunk ($$$$) {
 
        if (defined($spfx) && defined($oid_a) && defined($oid_b)) {
                my ($n) = ($ca =~ /^-([0-9]+)/);
-               $n = defined($n) ? do { ++$n; "#n$n" } : '';
+               $n = defined($n) ? "#n$n" : '';
 
                $$dst .= qq(@@ <a\nhref="$spfx$oid_a/s/$dctx->{Q}$n">$ca</a>);
 
                ($n) = ($cb =~ /^\+([0-9]+)/);
-               $n = defined($n) ? do { ++$n; "#n$n" } : '';
+               $n = defined($n) ? "#n$n" : '';
                $$dst .= qq( <a\nhref="$spfx$oid_b/s/$dctx->{Q}$n">$cb</a> @@);
        } else {
                $$dst .= "@@ $ca $cb @@";