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

Function changes_pack_for

atomic-cli/tests/it/git_binding_cb6c_test.rs:111–129  ·  view source on GitHub ↗

Assemble the bounded changes.pack for the closure from the local store.

(
    repo: &atomic_repository::Repository,
    ordered: &[atomic_core::Hash],
)

Source from the content-addressed store, hash-verified

109
110/// Assemble the bounded changes.pack for the closure from the local store.
111fn changes_pack_for(
112 repo: &atomic_repository::Repository,
113 ordered: &[atomic_core::Hash],
114) -> Vec<u8> {
115 let mut records = Vec::with_capacity(ordered.len());
116 for hash in ordered {
117 let bytes = fs::read(repo.change_store().change_path(hash)).expect("read change");
118 records.push(atomic_objects::ObjectRecord::new(
119 atomic_objects::ObjectFamily::Change,
120 atomic_core::Hash::of(&bytes).to_hex(),
121 bytes,
122 ));
123 }
124 atomic_repository::git_binding::assemble_changes_pack(
125 &records,
126 &atomic_repository::git_binding::BindingPackLimits::default_limits(),
127 )
128 .expect("assemble pack")
129}
130
131/// Publish a signed binding for `commit` (tree `tree_hex`) over the view's
132/// effective closure with the pack attached — the repository-level contract of

Callers 1

publish_binding_forFunction · 0.85

Calls 7

assemble_changes_packFunction · 0.85
readFunction · 0.70
lenMethod · 0.45
change_pathMethod · 0.45
change_storeMethod · 0.45
pushMethod · 0.45
to_hexMethod · 0.45

Tested by

no test coverage detected