(file: &ParsedFile, line_index: &ImportLineIndex)
| 752 | } |
| 753 | |
| 754 | fn import_shape_for_file(file: &ParsedFile, line_index: &ImportLineIndex) -> (usize, usize, usize) { |
| 755 | let indexed = line_index.files.get(&file.path).or_else(|| { |
| 756 | file.old_path |
| 757 | .as_deref() |
| 758 | .and_then(|old| line_index.files.get(old)) |
| 759 | }); |
| 760 | let current_lines = file |
| 761 | .new_content |
| 762 | .as_deref() |
| 763 | .or(file.old_content.as_deref()) |
| 764 | .map(count_line_units) |
| 765 | .or_else(|| indexed.map(|idx| idx.lines.len())) |
| 766 | .unwrap_or(0); |
| 767 | let indexed_lines = indexed.map(|idx| idx.lines.len()).unwrap_or(0); |
| 768 | let imported_commits = indexed.map(|idx| idx.imported_commits).unwrap_or(0); |
| 769 | (current_lines, indexed_lines, imported_commits) |
| 770 | } |
| 771 | |
| 772 | fn import_shape_summary(parsed: &ParsedCommit, line_index: &ImportLineIndex) -> String { |
| 773 | let mut entries: Vec<(usize, String)> = parsed |
no test coverage detected