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)
| 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> { |