Render a recorded change's computed file diffs — the header for the human unified form, then the configured format. Shared by the local `-c` body and the service-layer hook (one render, two data sources: the file diffs arrive from the graph or the wire).
(
&self,
change: &Change,
change_hash: &Hash,
config: &DiffOutputConfig,
file_diffs: Vec<FileDiff>,
stats: DiffStats,
)
| 462 | /// `-c` body and the service-layer hook (one render, two data sources: |
| 463 | /// the file diffs arrive from the graph or the wire). |
| 464 | pub(crate) fn print_change_file_diffs( |
| 465 | &self, |
| 466 | change: &Change, |
| 467 | change_hash: &Hash, |
| 468 | config: &DiffOutputConfig, |
| 469 | file_diffs: Vec<FileDiff>, |
| 470 | stats: DiffStats, |
| 471 | ) -> CliResult<()> { |
| 472 | if file_diffs.is_empty() { |
| 473 | self.print_no_changes(); |
| 474 | return Ok(()); |
| 475 | } |
| 476 | |
| 477 | // The human header duplicates what `--json` already carries under |
| 478 | // `change`, so skip it there. |
| 479 | if !self.json && config.format == DiffFormat::Unified { |
| 480 | self.print_change_header(change, change_hash, config); |
| 481 | } |
| 482 | |
| 483 | self.render( |
| 484 | &file_diffs, |
| 485 | &stats, |
| 486 | config, |
| 487 | Some((change, change_hash)), |
| 488 | None, |
| 489 | ) |
| 490 | } |
| 491 | |
| 492 | /// Reconstruct a line's text content from its leaf operations. |
| 493 | pub(super) fn reconstruct_line_from_leaf_ops(leaf_ops: &[LeafOp]) -> String { |
no test coverage detected