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

Method reseed_from_fallback_write

atomic-cli/src/commands/git/parallel.rs:651–682  ·  view source on GitHub ↗
(&mut self, repo: &Repository, parsed: &ParsedCommit)

Source from the content-addressed store, hash-verified

649 }
650
651 fn reseed_from_fallback_write(&mut self, repo: &Repository, parsed: &ParsedCommit) {
652 for file in &parsed.files {
653 match file.operation {
654 FileOperation::Deleted => {
655 self.files.remove(&file.path);
656 }
657 FileOperation::Renamed => {
658 if let Some(old_path) = file.old_path.as_deref() {
659 self.files.remove(old_path);
660 }
661 if let Some(new_content) = file.new_content.as_deref() {
662 let hint = self
663 .files
664 .get(&file.path)
665 .map(|indexed| indexed.imported_commits.saturating_add(1))
666 .unwrap_or(1);
667 self.seed_file_from_graph_content(repo, &file.path, new_content, hint);
668 }
669 }
670 FileOperation::Added | FileOperation::Copied | FileOperation::Modified => {
671 if let Some(new_content) = file.new_content.as_deref() {
672 let hint = self
673 .files
674 .get(&file.path)
675 .map(|indexed| indexed.imported_commits.saturating_add(1))
676 .unwrap_or(1);
677 self.seed_file_from_graph_content(repo, &file.path, new_content, hint);
678 }
679 }
680 }
681 }
682 }
683}
684
685#[derive(Debug)]

Callers 1

write_commitMethod · 0.80

Calls 3

removeMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected