This was buggy and was causing non-diff text to have extra
leading spaces. The diff parsing code needs to be cleaned up,
so this will be fixed, later.
This reverts commit
1a67b91c1326efa372d1ec957e2494849d894f0b.
# always support diff-highlighting, but we can't linkify hunk
# headers for solver unless some coderepo are configured:
my $diff;
- if ($s =~ /^([ \t]*)(?:diff|---|\+{3}) /ms) {
- $ctx->{-dpfx} = $1 if $1; # for format-patch --interdiff output
-
+ if ($s =~ /^(?:diff|---|\+{3}) /ms) {
# diffstat anchors do not link across attachments or messages:
$idx[0] = $upfx . $idx[0] if $upfx ne '';
$ctx->{-apfx} = join('/', @idx);
my $spfx = $ctx->{-spfx};
my $state = DSTATE_INIT;
my $dctx = { Q => '' }; # {}, keys: oid_a, oid_b, path_a, path_b
- my $dpfx = $ctx->{-dpfx}; # leading spaces for interdiff
- my $dpfx_re = qr/\A$dpfx/ if defined $dpfx;
foreach my $s (@$diff) {
- if (defined($dpfx)) {
- $s =~ s/$dpfx_re//;
- $$dst .= $dpfx;
- }
if ($s =~ /^---$/) {
to_state($dst, $state, DSTATE_STAT);
$$dst .= $s;