Append one tagged `.atomic/hook-errors.log` line. Best-effort: log I/O errors are ignored (the operation already surfaces its own outcome).
(repo_root: &Path, tag: &str, view: &str, detail: &str)
| 2162 | /// Append one tagged `.atomic/hook-errors.log` line. Best-effort: log I/O errors |
| 2163 | /// are ignored (the operation already surfaces its own outcome). |
| 2164 | fn append_shadow_log(repo_root: &Path, tag: &str, view: &str, detail: &str) { |
| 2165 | use std::io::Write; |
| 2166 | let log_path = repo_root.join(".atomic").join("hook-errors.log"); |
| 2167 | let entry = format!( |
| 2168 | "{} {} view={} {}\n", |
| 2169 | chrono::Utc::now().to_rfc3339(), |
| 2170 | tag, |
| 2171 | view, |
| 2172 | detail |
| 2173 | ); |
| 2174 | let _ = std::fs::OpenOptions::new() |
| 2175 | .create(true) |
| 2176 | .append(true) |
| 2177 | .open(&log_path) |
| 2178 | .and_then(|mut f| f.write_all(entry.as_bytes())); |
| 2179 | } |
| 2180 | |
| 2181 | /// Return the first staged index path that is a git-excluded shadow / provenance |
| 2182 | /// path (`.atomic/`, `.vault/`, or `.atomicignore`), or `None` if the candidate |
no test coverage detected