Observe the current Atomic view using graph-derived bytes only. This does not call `Repository::status` and never reads working-copy files.
(
root: &Path,
)
| 297 | /// |
| 298 | /// This does not call `Repository::status` and never reads working-copy files. |
| 299 | pub(crate) fn observe_current_atomic( |
| 300 | root: &Path, |
| 301 | ) -> Result<CheckpointAtomicState, CheckpointError> { |
| 302 | let repo = Repository::open_readonly(root).map_err(|error| { |
| 303 | CheckpointError::Atomic(format!("cannot open repository read-only: {error}")) |
| 304 | })?; |
| 305 | let working_copy = repo |
| 306 | .require_working_copy_id() |
| 307 | .map_err(|error| CheckpointError::Atomic(error.to_string()))?; |
| 308 | let view = repo |
| 309 | .desired_view_name(working_copy) |
| 310 | .map_err(|error| CheckpointError::Atomic(error.to_string()))?; |
| 311 | observe_atomic_on_handle(&repo, &view) |
| 312 | } |
| 313 | |
| 314 | fn observe_atomic_view(root: &Path, view: &str) -> Result<CheckpointAtomicState, CheckpointError> { |
| 315 | let repo = Repository::open_readonly(root).map_err(|error| { |
no test coverage detected