(&mut self, repo: &Repository, parsed: &ParsedCommit)
| 588 | } |
| 589 | |
| 590 | fn reseed_from_fallback_write(&mut self, repo: &Repository, parsed: &ParsedCommit) { |
| 591 | for file in &parsed.files { |
| 592 | match file.operation { |
| 593 | FileOperation::Deleted => { |
| 594 | self.files.remove(&file.path); |
| 595 | } |
| 596 | FileOperation::Renamed => { |
| 597 | if let Some(old_path) = file.old_path.as_deref() { |
| 598 | self.files.remove(old_path); |
| 599 | } |
| 600 | if let Some(new_content) = file.new_content.as_deref() { |
| 601 | let hint = self |
| 602 | .files |
| 603 | .get(&file.path) |
| 604 | .map(|indexed| indexed.imported_commits.saturating_add(1)) |
| 605 | .unwrap_or(1); |
| 606 | self.seed_file_from_graph_content(repo, &file.path, new_content, hint); |
| 607 | } |
| 608 | } |
| 609 | FileOperation::Added | FileOperation::Copied | FileOperation::Modified => { |
| 610 | if let Some(new_content) = file.new_content.as_deref() { |
| 611 | let hint = self |
| 612 | .files |
| 613 | .get(&file.path) |
| 614 | .map(|indexed| indexed.imported_commits.saturating_add(1)) |
| 615 | .unwrap_or(1); |
| 616 | self.seed_file_from_graph_content(repo, &file.path, new_content, hint); |
| 617 | } |
| 618 | } |
| 619 | } |
| 620 | } |
| 621 | } |
| 622 | } |
| 623 | |
| 624 | #[derive(Debug)] |
no test coverage detected