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:659–690  ·  view source on GitHub ↗
(&mut self, repo: &Repository, parsed: &ParsedCommit)

Source from the content-addressed store, hash-verified

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

Callers 1

write_commitMethod · 0.80

Calls 3

removeMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected