Shared adapter for service paths that already own a repository handle.
(
repo: &mut Repository,
mode: atomic_repository::WorkspaceTxnMode,
)
| 266 | |
| 267 | /// Shared adapter for service paths that already own a repository handle. |
| 268 | pub(super) fn enter_workspace( |
| 269 | repo: &mut Repository, |
| 270 | mode: atomic_repository::WorkspaceTxnMode, |
| 271 | ) -> Result<atomic_repository::WorkspaceTxn, Status> { |
| 272 | match repo.begin_workspace_txn(mode).map_err(repository_error)? { |
| 273 | atomic_repository::WorkspaceTxnStart::Ready(workspace) => Ok(workspace), |
| 274 | atomic_repository::WorkspaceTxnStart::Remediation(remediation) => Err(domain_status( |
| 275 | ErrorCode::PreconditionFailed, |
| 276 | format!( |
| 277 | "workspace reconciliation required: {}\nInspect with 'atomic status --no-reconcile'; then run 'atomic git shim reconcile' before retrying.", |
| 278 | remediation.describe() |
| 279 | ), |
| 280 | )), |
| 281 | } |
| 282 | } |
| 283 | |
| 284 | pub struct DaemonState { |
| 285 | repos: Mutex<HashMap<Vec<u8>, std::sync::Arc<RepoHandle>>>, |
no test coverage detected