diff options
Diffstat (limited to 'crates/vcs_data/src/data/local/local_sheet.rs')
| -rw-r--r-- | crates/vcs_data/src/data/local/local_sheet.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/crates/vcs_data/src/data/local/local_sheet.rs b/crates/vcs_data/src/data/local/local_sheet.rs index 378d589..4ebdaac 100644 --- a/crates/vcs_data/src/data/local/local_sheet.rs +++ b/crates/vcs_data/src/data/local/local_sheet.rs @@ -199,6 +199,16 @@ impl LocalMappingMetadata { pub fn set_last_modifiy_check_result(&mut self, result: bool) { self.last_modifiy_check_result = result; } + + /// Getter for last_modifiy_check_hash + pub fn last_modifiy_check_hash(&self) -> &Option<String> { + &self.last_modifiy_check_hash + } + + /// Setter for last_modifiy_check_hash + pub fn set_last_modifiy_check_hash(&mut self, hash: Option<String>) { + self.last_modifiy_check_hash = hash; + } } impl Default for LocalMappingMetadata { @@ -291,6 +301,21 @@ impl<'a> LocalSheet<'a> { Ok(()) } + /// Remove mapping from local sheet + pub fn remove_mapping( + &mut self, + path: &LocalFilePathBuf, + ) -> Result<LocalMappingMetadata, std::io::Error> { + let path = format_path(path)?; + match self.data.mapping.remove(&path) { + Some(mapping) => Ok(mapping), + None => Err(Error::new( + std::io::ErrorKind::NotFound, + "Path is not found.", + )), + } + } + /// Get immutable mapping data pub fn mapping_data( &self, |
