MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / import_shape_for_file

Function import_shape_for_file

atomic-cli/src/commands/git/parallel.rs:762–778  ·  view source on GitHub ↗
(file: &ParsedFile, line_index: &ImportLineIndex)

Source from the content-addressed store, hash-verified

760}
761
762fn import_shape_for_file(file: &ParsedFile, line_index: &ImportLineIndex) -> (usize, usize, usize) {
763 let indexed = line_index.files.get(&file.path).or_else(|| {
764 file.old_path
765 .as_deref()
766 .and_then(|old| line_index.files.get(old))
767 });
768 let current_lines = file
769 .new_content
770 .as_deref()
771 .or(file.old_content.as_deref())
772 .map(count_line_units)
773 .or_else(|| indexed.map(|idx| idx.lines.len()))
774 .unwrap_or(0);
775 let indexed_lines = indexed.map(|idx| idx.lines.len()).unwrap_or(0);
776 let imported_commits = indexed.map(|idx| idx.imported_commits).unwrap_or(0);
777 (current_lines, indexed_lines, imported_commits)
778}
779
780fn import_shape_summary(parsed: &ParsedCommit, line_index: &ImportLineIndex) -> String {
781 let mut entries: Vec<(usize, String)> = parsed

Callers 1

import_shape_summaryFunction · 0.85

Calls 2

getMethod · 0.65
lenMethod · 0.45

Tested by

no test coverage detected