From 0eaf06c1c2acc65ebc7e45d0d4913958264c3dd1 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 11 Jan 2017 04:12:29 +0000 Subject: repobrowse: make git diff output use qspawn This is a potentially expensive operation, so we may want to give it it's own limiter channel. --- lib/PublicInbox/RepobrowseGitDiffCommon.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/PublicInbox/RepobrowseGitDiffCommon.pm') diff --git a/lib/PublicInbox/RepobrowseGitDiffCommon.pm b/lib/PublicInbox/RepobrowseGitDiffCommon.pm index ae0e6821..bca50e15 100644 --- a/lib/PublicInbox/RepobrowseGitDiffCommon.pm +++ b/lib/PublicInbox/RepobrowseGitDiffCommon.pm @@ -216,6 +216,9 @@ sub git_diff_sed_stat ($$) { my $ndel = \($req->{ndel}); if (!$req->{dstat_started}) { $req->{dstat_started} = 1; + + # merges start with an extra '\0' before the diffstat + # non-merge commits start with an extra '\n', instead if ($req->{mhelp}) { if ($stat[0] eq '') { shift @stat; @@ -224,8 +227,8 @@ sub git_diff_sed_stat ($$) { 'initial merge diffstat line was not empty'; } } else { - $stat[0] =~ s/\A\n//s or warn -'failed to remove initial newline from diffstat'; + # for commits, only (not diff-tree) + $stat[0] =~ s/\A\n//s; } } while (defined(my $l = shift @stat)) { -- cgit v1.2.3-24-ge0c7