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

Function find_local_only_changes

atomic-cli/src/commands/pull/helpers.rs:154–165  ·  view source on GitHub ↗

Find all local-only change hashes. Returns the base32-encoded hashes of all changes that exist locally but not on the remote. # Arguments `local_entries` - Local history entries `remote_entries` - Remote changelist entries # Returns A vector of base32-encoded hashes of local-only changes.

(
    local_entries: &[HistoryEntry],
    remote_entries: &[ChangelistEntry],
)

Source from the content-addressed store, hash-verified

152///
153/// A vector of base32-encoded hashes of local-only changes.
154pub fn find_local_only_changes(
155 local_entries: &[HistoryEntry],
156 remote_entries: &[ChangelistEntry],
157) -> Vec<String> {
158 let remote_hashes: HashSet<String> = remote_entries.iter().map(|e| e.hash.clone()).collect();
159
160 local_entries
161 .iter()
162 .filter(|e| !remote_hashes.contains(&e.hash.to_base32()))
163 .map(|e| e.hash.to_base32())
164 .collect()
165}
166
167// Change Data Operations
168

Callers 3

run_asyncMethod · 0.85

Calls 5

collectMethod · 0.45
iterMethod · 0.45
cloneMethod · 0.45
containsMethod · 0.45
to_base32Method · 0.45