diff --git a/gix-index/src/access/mod.rs b/gix-index/src/access/mod.rs index 166dc9a4038..8cf9cd57610 100644 --- a/gix-index/src/access/mod.rs +++ b/gix-index/src/access/mod.rs @@ -553,6 +553,10 @@ impl State { pub fn tree(&self) -> Option<&extension::Tree> { self.tree.as_ref() } + /// Remove the `tree` extension. + pub fn remove_tree(&mut self) -> Option { + self.tree.take() + } /// Access the `link` extension. pub fn link(&self) -> Option<&extension::Link> { self.link.as_ref() @@ -561,6 +565,10 @@ impl State { pub fn resolve_undo(&self) -> Option<&extension::resolve_undo::Paths> { self.resolve_undo.as_ref() } + /// Remove the resolve-undo extension. + pub fn remove_resolve_undo(&mut self) -> Option { + self.resolve_undo.take() + } /// Obtain the untracked extension. pub fn untracked(&self) -> Option<&extension::UntrackedCache> { self.untracked.as_ref()