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])
| 1050 | /// honestly treat as unauthenticated rather than operation linkage. The |
| 1051 | /// advisory hook must never break Git, so failures become warnings. |
| 1052 | fn capture_event_bytes(root: &Path, event_bytes: &[u8]) -> CliResult<()> { |
| 1053 | if let Err(error) = (|| -> Result<(), CliError> { |
| 1054 | let repo = atomic_repository::Repository::open(root) |
| 1055 | .map_err(|error| git_error(format!("cannot open the Atomic repository: {error}")))?; |
| 1056 | repo.capture_shim_event(event_bytes) |
| 1057 | .map_err(|error| git_error(format!("cannot capture shim event: {error}")))?; |
| 1058 | Ok(()) |
| 1059 | })() { |
| 1060 | print_warning(&format!( |
| 1061 | "post-rewrite event {} was journaled but not captured immutably ({error}); \ |
| 1062 | it will read as unauthenticated evidence, not operation linkage", |
| 1063 | "post-rewrite" |
| 1064 | )); |
| 1065 | } |
| 1066 | Ok(()) |
| 1067 | } |
| 1068 | |
| 1069 | /// CB-9B: journal `reference-transaction` evidence from Git's actual wire |
| 1070 | /// format (review blocker 5): the transaction state arrives as `argv[1]` and |
no test coverage detected