(&mut self, repo: &Repository, parsed: &ParsedCommit)
| 701 | } |
| 702 | |
| 703 | fn reseed_from_fallback_write(&mut self, repo: &Repository, parsed: &ParsedCommit) { |
| 704 | for file in &parsed.files { |
| 705 | match file.operation { |
| 706 | FileOperation::Deleted => { |
| 707 | self.files.remove(&file.path); |
| 708 | } |
| 709 | FileOperation::Renamed => { |
| 710 | if let Some(old_path) = file.old_path.as_deref() { |
| 711 | self.files.remove(old_path); |
| 712 | } |
| 713 | if let Some(new_content) = file.new_content.as_deref() { |
| 714 | let hint = self |
| 715 | .files |
| 716 | .get(&file.path) |
| 717 | .map(|indexed| indexed.imported_commits.saturating_add(1)) |
| 718 | .unwrap_or(1); |
| 719 | self.seed_file_from_graph_content(repo, &file.path, new_content, hint); |
| 720 | } |
| 721 | } |
| 722 | FileOperation::Added | FileOperation::Copied | FileOperation::Modified => { |
| 723 | if let Some(new_content) = file.new_content.as_deref() { |
| 724 | let hint = self |
| 725 | .files |
| 726 | .get(&file.path) |
| 727 | .map(|indexed| indexed.imported_commits.saturating_add(1)) |
| 728 | .unwrap_or(1); |
| 729 | self.seed_file_from_graph_content(repo, &file.path, new_content, hint); |
| 730 | } |
| 731 | } |
| 732 | } |
| 733 | } |
| 734 | } |
| 735 | } |
| 736 | |
| 737 | #[derive(Debug)] |
no test coverage detected