Fix staging and unstaging of added and deleted files (#25631)
* When staging in a buffer whose file has been deleted, do not save the file * Fix logic for writing to index when file is deleted Release Notes: - N/A
This commit is contained in:
parent
33754f8eac
commit
ebccef1aa4
6 changed files with 88 additions and 48 deletions
|
@ -368,6 +368,14 @@ impl DiskState {
|
|||
DiskState::Deleted => None,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn exists(&self) -> bool {
|
||||
match self {
|
||||
DiskState::New => false,
|
||||
DiskState::Present { .. } => true,
|
||||
DiskState::Deleted => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// The file associated with a buffer, in the case where the file is on the local disk.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue