Semantic checkpoint equality (review R5). The raw index digest is evidence, not semantics: a stat-only index refresh changes the file bytes (and its digest) without changing the represented tree. When both sides observed an index tree, tree equality proves the index semantically unchanged even if the digest drifted. A digest drift without a readable tree stays INEQUALITY (uncertainty is never equ
(
start: &GitBoundaryCheckpoint,
end: &GitBoundaryCheckpoint,
)
| 277 | /// index semantically unchanged even if the digest drifted. A digest drift |
| 278 | /// without a readable tree stays INEQUALITY (uncertainty is never equality). |
| 279 | fn checkpoints_semantically_equal( |
| 280 | start: &GitBoundaryCheckpoint, |
| 281 | end: &GitBoundaryCheckpoint, |
| 282 | ) -> bool { |
| 283 | let index_equal = match (&start.index_digest, &end.index_digest) { |
| 284 | (Some(a), Some(b)) if a == b => true, |
| 285 | (Some(_), Some(_)) => start.index_tree.is_some() && end.index_tree.is_some(), |
| 286 | _ => start.index_digest == end.index_digest, |
| 287 | }; |
| 288 | start.head_oid == end.head_oid |
| 289 | && start.head_symref == end.head_symref |
| 290 | && start.head_tree == end.head_tree |
| 291 | && start.index_tree == end.index_tree |
| 292 | && index_equal |
| 293 | && start.repository_state == end.repository_state |
| 294 | && start.markers == end.markers |
| 295 | } |
| 296 | |
| 297 | /// Whether the observed HEAD move is explained by an anchored journal record. |
| 298 | /// |
no outgoing calls
no test coverage detected