Describe what moved between two Git checkpoints (observed-operation-only).
(
start: &GitBoundaryCheckpoint,
end: &GitBoundaryCheckpoint,
)
| 225 | |
| 226 | /// Describe what moved between two Git checkpoints (observed-operation-only). |
| 227 | fn describe_git_transition( |
| 228 | start: &GitBoundaryCheckpoint, |
| 229 | end: &GitBoundaryCheckpoint, |
| 230 | ) -> Vec<String> { |
| 231 | let mut operations = Vec::new(); |
| 232 | if start.head_oid != end.head_oid { |
| 233 | operations.push(format!( |
| 234 | "HEAD {} -> {}", |
| 235 | start.head_oid.as_deref().unwrap_or("<unborn>"), |
| 236 | end.head_oid.as_deref().unwrap_or("<unborn>") |
| 237 | )); |
| 238 | } |
| 239 | if start.index_digest != end.index_digest { |
| 240 | operations.push(format!( |
| 241 | "primary index {} -> {}", |
| 242 | start |
| 243 | .index_digest |
| 244 | .as_ref() |
| 245 | .map(|digest| digest.to_base32()) |
| 246 | .unwrap_or_else(|| "<unreadable>".to_string()), |
| 247 | end.index_digest |
| 248 | .as_ref() |
| 249 | .map(|digest| digest.to_base32()) |
| 250 | .unwrap_or_else(|| "<unreadable>".to_string()) |
| 251 | )); |
| 252 | } |
| 253 | if start.repository_state != end.repository_state || start.markers != end.markers { |
| 254 | operations.push("git operation state changed".to_string()); |
| 255 | } |
| 256 | if operations.is_empty() { |
| 257 | operations.push("non-checkpoint git state changed".to_string()); |
| 258 | } |
| 259 | operations |
| 260 | } |
| 261 | |
| 262 | /// Resolve the sessions directory the same way the pre-commit producer and |
| 263 | /// the orchestrator do: the canonical common `.atomic` (review R9). Reading |
no test coverage detected