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

Function unaddable_managed_commit_refusal

atomic-agent/src/record/mod.rs:1133–1142  ·  view source on GitHub ↗

Build the refusal for an exact managed commit with a path Atomic cannot start tracking (a file replaced by a directory of the same name, for one). Skipping that path would record only part of the commit, so the turn records nothing instead. `None` when the turn has no exact managed commit, where skipping an unaddable path stays the best effort.

(
    options: &TurnRecordOptions<'_>,
    git_transition: &Option<RecordedGitTransition>,
    add_error: &dyn std::fmt::Display,
)

Source from the content-addressed store, hash-verified

1131/// turn records nothing instead. `None` when the turn has no exact managed
1132/// commit, where skipping an unaddable path stays the best effort.
1133fn unaddable_managed_commit_refusal(
1134 options: &TurnRecordOptions<'_>,
1135 git_transition: &Option<RecordedGitTransition>,
1136 add_error: &dyn std::fmt::Display,
1137) -> Option<InexactManagedCommit> {
1138 let transition = git_transition.as_ref()?;
1139 let commit = transition.exact_commit_oid.as_deref()?;
1140 let reason = format!("Atomic cannot track every path the commit adds: {add_error}");
1141 Some(managed_commit_refusal(options, transition, commit, &reason))
1142}
1143
1144/// The durable refusal for a managed commit that is not recorded as-is.
1145fn managed_commit_refusal(

Callers 1

record_turnFunction · 0.85

Calls 2

managed_commit_refusalFunction · 0.85
as_refMethod · 0.80

Tested by

no test coverage detected