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

Function single_insert

libatomic/src/daemon/services.rs:1121–1137  ·  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

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