Fix inconsistent worktree state when renaming entries while scanning
This commit is contained in:
parent
bb1cfd51b8
commit
5ea49b3ae3
1 changed files with 6 additions and 1 deletions
|
@ -1491,7 +1491,12 @@ impl LocalSnapshot {
|
||||||
}
|
}
|
||||||
|
|
||||||
let scan_id = self.scan_id;
|
let scan_id = self.scan_id;
|
||||||
self.entries_by_path.insert_or_replace(entry.clone(), &());
|
let removed = self.entries_by_path.insert_or_replace(entry.clone(), &());
|
||||||
|
if let Some(removed) = removed {
|
||||||
|
if removed.id != entry.id {
|
||||||
|
self.entries_by_id.remove(&removed.id, &());
|
||||||
|
}
|
||||||
|
}
|
||||||
self.entries_by_id.insert_or_replace(
|
self.entries_by_id.insert_or_replace(
|
||||||
PathEntry {
|
PathEntry {
|
||||||
id: entry.id,
|
id: entry.id,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue