MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / remediation

Method remediation

atomic-repository/src/repository/workspace_txn.rs:798–814  ·  view source on GitHub ↗

Commands that resolve this state when a single safe path exists. Ordinary boundaries only observe Git for shim workspaces ([`Repository::shim_workspace_active`]), so these states are reached after an explicit opt-in or anchoring.

(&self)

Source from the content-addressed store, hash-verified

796 /// ([`Repository::shim_workspace_active`]), so these states are reached
797 /// after an explicit opt-in or anchoring.
798 pub fn remediation(&self) -> Option<String> {
799 const DISABLE: &str = "To use Atomic without the Git shim in a workspace that was never \
800anchored:\n atomic git shim disable";
801 match self {
802 Self::MissingCheckpoint => Some(format!(
803 "The Git shim is enabled for this repository, but this workspace has no \
804verified Git baseline yet. Anchor it to the current Git HEAD (imports the Git \
805history into the current view):\n atomic git shim reconcile\n{DISABLE}"
806 )),
807 Self::UnbornHead { symref } => Some(format!(
808 "{symref} has no commits yet, so there is no Git baseline to anchor to. \
809Create the first Git commit (or switch to a branch that has commits), then \
810anchor the workspace:\n git add <paths> && git commit\n atomic git shim reconcile\n{DISABLE}"
811 )),
812 _ => None,
813 }
814 }
815}
816
817/// Checkpoint fields needed by the entry protocol. Reading never rewrites legacy data.

Callers 1

describeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected