The operation capture token carried by post-rewrite event bytes (review E2), or `None` when the bytes carry no capture token. Bare Git ` ` wire pairs never carry a token. The durable JSON evidence record the hook journals during a prepared operation's capture context carries the minted token in its `capture_token` field. Anchoring compares this token against the operation's minted conte
(bytes: &[u8])
| 696 | /// compares this token against the operation's minted context, so only a |
| 697 | /// capture produced within the prepared operation can bind to it. |
| 698 | pub fn post_rewrite_event_capture_token(bytes: &[u8]) -> Option<String> { |
| 699 | let record: serde_json::Value = serde_json::from_slice(bytes).ok()?; |
| 700 | if record.get("record_type").and_then(|v| v.as_str()) != Some("post-rewrite") { |
| 701 | return None; |
| 702 | } |
| 703 | let token = record.get("capture_token")?.as_str()?; |
| 704 | if token.is_empty() { |
| 705 | None |
| 706 | } else { |
| 707 | Some(token.to_string()) |
| 708 | } |
| 709 | } |
| 710 | |
| 711 | /// Whether a Git-ref effect lease value equals the parsed OID (an all-zero |
| 712 | /// OID matches the absent lease, matching Git's zero-OID ref conventions). |
no test coverage detected