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:156–167  ·  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

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

Callers 3

run_asyncMethod · 0.85

Calls 4

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