From ead13b7fe78e8c81478d4c8a4bf20ad1920e380a Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Mon, 15 Dec 2025 21:26:37 +0800 Subject: Add getter and setter for last_modifiy_check_hash and remove_mapping method --- crates/vcs_data/src/data/local/local_sheet.rs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) 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 { + &self.last_modifiy_check_hash + } + + /// Setter for last_modifiy_check_hash + pub fn set_last_modifiy_check_hash(&mut self, hash: Option) { + 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 { + 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, -- cgit