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

Function normalize_rename_collisions

atomic-cli/src/commands/git/parallel.rs:9327–9336  ·  view source on GitHub ↗

Resolve a rename that collides with another delta of the same commit. Rename detection pairs a vacated blob with an added path even when the commit re-occupies the vacated path (emanote `dc1fb69`: `README.md` moved into `emanote/` while a symlink to the moved file takes the old path) or deletes the entry that held the target path (the mirror: a symlink replaced by the regular file it pointed to).

(files: Vec<ParsedFile>)

Source from the content-addressed store, hash-verified

9325/// Modified delta of the target carrying the deleted entry's bytes as its
9326/// baseline. Ordinary renames, swaps and rotations are returned untouched.
9327fn normalize_rename_collisions(files: Vec<ParsedFile>) -> Vec<ParsedFile> {
9328 let collisions = RenameCollisions::collect(&files);
9329 if collisions.is_empty() {
9330 return files;
9331 }
9332 files
9333 .into_iter()
9334 .map(|file| collisions.rewrite(file))
9335 .collect()
9336}
9337
9338fn parse_diff_files_via_git_cli(
9339 git_repo: &GitRepository,

Calls 5

rewriteMethod · 0.80
collectFunction · 0.70
is_emptyMethod · 0.45
collectMethod · 0.45
into_iterMethod · 0.45