diff options
Diffstat (limited to 'lib/PublicInbox/ViewDiff.pm')
-rw-r--r-- | lib/PublicInbox/ViewDiff.pm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/PublicInbox/ViewDiff.pm b/lib/PublicInbox/ViewDiff.pm index 0f5c0e4e..57a1b5d6 100644 --- a/lib/PublicInbox/ViewDiff.pm +++ b/lib/PublicInbox/ViewDiff.pm @@ -20,6 +20,9 @@ sub UNSAFE () { "^A-Za-z0-9\-\._~/" } my $OID_NULL = '0{7,40}'; my $OID_BLOB = '[a-f0-9]{7,40}'; +my $LF = qr!\n!; +my $ANY = qr![^\n]!; +my $FN = qr!(?:"?[^/\n]+/[^\n]+|/dev/null)!; # cf. git diff.c :: get_compact_summary my $DIFFSTAT_COMMENT = qr/\((?:new|gone|(?:(?:new|mode) [\+\-][lx]))\)/; @@ -170,9 +173,6 @@ sub diff_before_or_after ($$$) { # callers must do CRLF => LF conversion before calling this sub flush_diff ($$$) { my ($dst, $ctx, $cur) = @_; - state $LF = qr!\n!; - state $ANY = qr![^\n]!; - state $FN = qr!(?:"?[^/\n]+/[^\n]+|/dev/null)!; my @top = split(/( (?: # begin header stuff, don't capture filenames, here, |