From: Eric Wong Date: Mon, 4 Jan 2016 21:30:07 +0000 (+0000) Subject: repobrowse: commit view handles lack of commas in hunk headers X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=246d737f4d0233e6e4c3d8e6bf612ec766ce62de;p=thirdparty%2Fpublic-inbox.git repobrowse: commit view handles lack of commas in hunk headers Hunk headers in diffs may not have a comma in them for symlinks. --- diff --git a/lib/PublicInbox/RepoBrowseGitCommit.pm b/lib/PublicInbox/RepoBrowseGitCommit.pm index 0b1d08bc0..3f4148fbd 100644 --- a/lib/PublicInbox/RepoBrowseGitCommit.pm +++ b/lib/PublicInbox/RepoBrowseGitCommit.pm @@ -246,8 +246,8 @@ sub git_diff_ab_hdr { # @@ -1,2 +3,4 @@ (regular diff) sub git_diff_ab_hunk { my ($diff, $ca, $cb, $ctx) = @_; - my ($na) = ($ca =~ /\A-(\d+),/); - my ($nb) = ($cb =~ /\A\+(\d+),/); + my ($na) = ($ca =~ /\A-(\d+)/); + my ($nb) = ($cb =~ /\A\+(\d+)/); my $rel = $diff->{rel}; my $rv = '@@ '; @@ -309,7 +309,7 @@ sub git_diff_cc_hunk { foreach my $off (@offs) { my $p = shift @p; my $obj = shift @pobj; # blob SHA-1 - my ($n) = ($off =~ /\A-(\d+),/); # line number + my ($n) = ($off =~ /\A-(\d+)/); # line number if ($n == 0) { # new file (does this happen with --cc?) $rv .= " $off"; @@ -320,7 +320,7 @@ sub git_diff_cc_hunk { } # we can use the normal 'tree' endpoint for the result - my ($n) = ($last =~ /\A\+(\d+),/); # line number + my ($n) = ($last =~ /\A\+(\d+)/); # line number if ($n == 0) { # deleted file (does this happen with --cc?) $rv .= " $last"; } else {