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>,
)
| 204 | /// the single source of truth used by `atomic git import --dry-run` to forecast |
| 205 | /// the real import count. Callers must only invoke it for incremental imports. |
| 206 | pub(crate) fn incremental_import_skips( |
| 207 | sha: &str, |
| 208 | message: &str, |
| 209 | imported_shas: &HashSet<String>, |
| 210 | target_view: &str, |
| 211 | known_states: &HashSet<Merkle>, |
| 212 | ) -> bool { |
| 213 | if imported_shas.contains(sha) { |
| 214 | return true; |
| 215 | } |
| 216 | match parse_push_trailer(message) { |
| 217 | Some(trailer) => self_push_state_known(&trailer, target_view, known_states), |
| 218 | None => false, |
| 219 | } |
| 220 | } |
| 221 | |
| 222 | /// Metadata extracted from a git commit. |
| 223 | #[derive(Debug, Clone)] |
no test coverage detected