Enter a stable workspace transaction or convert remediation into one CLI refusal.
(
repository: &mut Repository,
mode: WorkspaceTxnMode,
)
| 21 | |
| 22 | /// Enter a stable workspace transaction or convert remediation into one CLI refusal. |
| 23 | pub(crate) fn enter_workspace( |
| 24 | repository: &mut Repository, |
| 25 | mode: WorkspaceTxnMode, |
| 26 | ) -> CliResult<WorkspaceTxn> { |
| 27 | match repository |
| 28 | .begin_workspace_txn(mode) |
| 29 | .map_err(CliError::Repository)? |
| 30 | { |
| 31 | WorkspaceTxnStart::Ready(transaction) => Ok(transaction), |
| 32 | WorkspaceTxnStart::Remediation(remediation) => Err(remediation_error(remediation)), |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | /// Observe a workspace boundary while allowing forensic commands to report unsafe state. |
| 37 | pub(crate) fn observe_workspace( |