Skip to content

Commit 668cb12

Browse files
committed
feat: add State::remove_(tree|resolve_undo)() to remove possibly outdated extensions.
1 parent 8173096 commit 668cb12

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

gix-index/src/access/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,10 @@ impl State {
553553
pub fn tree(&self) -> Option<&extension::Tree> {
554554
self.tree.as_ref()
555555
}
556+
/// Remove the `tree` extension.
557+
pub fn remove_tree(&mut self) -> Option<extension::Tree> {
558+
self.tree.take()
559+
}
556560
/// Access the `link` extension.
557561
pub fn link(&self) -> Option<&extension::Link> {
558562
self.link.as_ref()
@@ -561,6 +565,10 @@ impl State {
561565
pub fn resolve_undo(&self) -> Option<&extension::resolve_undo::Paths> {
562566
self.resolve_undo.as_ref()
563567
}
568+
/// Remove the resolve-undo extension.
569+
pub fn remove_resolve_undo(&mut self) -> Option<extension::resolve_undo::Paths> {
570+
self.resolve_undo.take()
571+
}
564572
/// Obtain the untracked extension.
565573
pub fn untracked(&self) -> Option<&extension::UntrackedCache> {
566574
self.untracked.as_ref()

0 commit comments

Comments
 (0)