Capture `event_bytes` through the repository library into the pristine database. Best-effort by design: a failure (lock contention, read-only repository) leaves the event journal-only, which downstream readers honestly treat as unauthenticated rather than operation linkage. The advisory hook must never break Git, so failures become warnings.
(root: &Path, event_bytes: &[u8])
| 1081 | /// honestly treat as unauthenticated rather than operation linkage. The |
| 1082 | /// advisory hook must never break Git, so failures become warnings. |
| 1083 | fn capture_event_bytes(root: &Path, event_bytes: &[u8]) -> CliResult<()> { |
| 1084 | if let Err(error) = (|| -> Result<(), CliError> { |
| 1085 | let repo = atomic_repository::Repository::open(root) |
| 1086 | .map_err(|error| git_error(format!("cannot open the Atomic repository: {error}")))?; |
| 1087 | repo.capture_shim_event(event_bytes) |
| 1088 | .map_err(|error| git_error(format!("cannot capture shim event: {error}")))?; |
| 1089 | Ok(()) |
| 1090 | })() { |
| 1091 | print_warning(&format!( |
| 1092 | "post-rewrite event {} was journaled but not captured immutably ({error}); \ |
| 1093 | it will read as unauthenticated evidence, not operation linkage", |
| 1094 | "post-rewrite" |
| 1095 | )); |
| 1096 | } |
| 1097 | Ok(()) |
| 1098 | } |
| 1099 | |
| 1100 | /// CB-9B: journal `reference-transaction` evidence from Git's actual wire |
| 1101 | /// format (review blocker 5): the transaction state arrives as `argv[1]` and |
no test coverage detected