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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user