+ if ($s =~ /^(?:diff|---|\+\+\+) /ms) {
+ open(my $fh, '+>:utf8', undef) or die "open: $!";
+ open(my $eh, '+>', undef) or die "open: $!";
+ $fh->autoflush(1);
+ print $fh $s or die "print: $!";
+ sysseek($fh, 0, SEEK_SET) or die "sysseek: $!";
+ my $id = ($self->{ibx} // $self->{eidx})->git->qx(
+ [qw(patch-id --stable)],
+ {}, { 0 => $fh, 2 => $eh });
+ $id =~ /\A([a-f0-9]{40,})/ and $doc->add_term('XDFID'.$1);
+ seek($eh, 0, SEEK_SET) or die "seek: $!";
+ while (<$eh>) { warn $_ }
+ }
+