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)
| 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> { |
no test coverage detected