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

Method add_or_replace_entry

atomic-repository/src/status.rs:561–567  ·  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

559 /// Used to let a Conflicted entry supersede a Modified one so a file is
560 /// reported exactly once.
561 pub fn add_or_replace_entry(&mut self, entry: FileStatusEntry) {
562 if let Some(&i) = self.path_index.get(&entry.path) {
563 self.entries[i] = entry;
564 } else {
565 self.add_entry(entry);
566 }
567 }
568
569 /// Get the status entry for a specific path.
570 pub fn get(&self, path: &Path) -> Option<&FileStatusEntry> {

Callers 2

status_innerMethod · 0.80

Calls 2

add_entryMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected