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

Function single_insert

libatomic/src/daemon/services.rs:1120–1136  ·  view source on GitHub ↗

The single-insert domain calls the local single-insert body makes: the dependency closure by default, `--deps=false` skips it (the plain insert path).

(
    repo: &Repository,
    hash: &atomic_core::types::Merkle,
    target: &str,
    apply_dependencies: bool,
    allow_conflicts: bool,
)

Source from the content-addressed store, hash-verified

1118/// the dependency closure by default, `--deps=false` skips it (the
1119/// plain insert path).
1120fn single_insert(
1121 repo: &Repository,
1122 hash: &atomic_core::types::Merkle,
1123 target: &str,
1124 apply_dependencies: bool,
1125 allow_conflicts: bool,
1126) -> Result<atomic_repository::InsertOutcome, atomic_repository::RepositoryError> {
1127 let options = InsertOptions::default()
1128 .apply_deps(apply_dependencies)
1129 .allow_conflict(allow_conflicts)
1130 .view(target.to_string());
1131 if apply_dependencies {
1132 repo.insert_change_rec(hash, options)
1133 } else {
1134 repo.insert_change(hash, options)
1135 }
1136}
1137
1138pub(crate) fn default_ref() -> RepositoryRef {
1139 RepositoryRef {

Callers 1

insert_changesMethod · 0.85

Calls 5

allow_conflictMethod · 0.80
apply_depsMethod · 0.80
insert_change_recMethod · 0.80
viewMethod · 0.45
insert_changeMethod · 0.45

Tested by

no test coverage detected