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

Method add_or_replace_entry

atomic-repository/src/status.rs:489–495  ·  view source on GitHub ↗

Add an entry, replacing any existing entry for the same path. Used to let a Conflicted entry supersede a Modified one so a file is reported exactly once.

(&mut self, entry: FileStatusEntry)

Source from the content-addressed store, hash-verified

487 /// Used to let a Conflicted entry supersede a Modified one so a file is
488 /// reported exactly once.
489 pub fn add_or_replace_entry(&mut self, entry: FileStatusEntry) {
490 if let Some(&i) = self.path_index.get(&entry.path) {
491 self.entries[i] = entry;
492 } else {
493 self.add_entry(entry);
494 }
495 }
496
497 /// Get the status entry for a specific path.
498 pub fn get(&self, path: &Path) -> Option<&FileStatusEntry> {

Callers 1

statusMethod · 0.80

Calls 2

add_entryMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected