Whether an incremental import would skip the git commit identified by `sha` with the given commit `message`, for a target view that already contains `imported_shas` and `known_states`. This mirrors exactly what the real importer does — the SHA skip in `collect_commit_oids` (already-imported commits) plus the self-push skip in `phase2_write` (commits whose carried view state is already present). I
(
sha: &str,
message: &str,
imported_shas: &HashSet<String>,
target_view: &str,
known_states: &HashSet<Merkle>,
)
| 607 | /// the single source of truth used by `atomic git import --dry-run` to forecast |
| 608 | /// the real import count. Callers must only invoke it for incremental imports. |
| 609 | pub(crate) fn incremental_import_skips( |
| 610 | sha: &str, |
| 611 | message: &str, |
| 612 | imported_shas: &HashSet<String>, |
| 613 | target_view: &str, |
| 614 | known_states: &HashSet<Merkle>, |
| 615 | ) -> bool { |
| 616 | if imported_shas.contains(sha) { |
| 617 | return true; |
| 618 | } |
| 619 | match parse_push_trailer(message) { |
| 620 | Some(trailer) => self_push_state_known(&trailer, target_view, known_states), |
| 621 | None => false, |
| 622 | } |
| 623 | } |
| 624 | |
| 625 | /// Metadata extracted from a git commit. |
| 626 | #[derive(Debug, Clone)] |
no test coverage detected