Skip to content

Commit

Permalink
adapt to changes in gix-dir
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Feb 15, 2024
1 parent 347bed2 commit 87f710a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion gix/src/dirwalk.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use gix_dir::walk::{EmissionMode, ForDeletionMode};
use gix_dir::walk::{CollapsedEntriesEmissionMode, EmissionMode, ForDeletionMode};

/// Options for use in the [`Repository::dirwalk()`](crate::Repository::dirwalk()) function.
///
Expand All @@ -16,6 +16,7 @@ pub struct Options {
emit_untracked: EmissionMode,
emit_empty_directories: bool,
classify_untracked_bare_repositories: bool,
emit_collapsed: Option<CollapsedEntriesEmissionMode>,
}

/// Construction
Expand All @@ -32,6 +33,7 @@ impl Options {
emit_untracked: Default::default(),
emit_empty_directories: false,
classify_untracked_bare_repositories: false,
emit_collapsed: None,
}
}
}
Expand All @@ -49,6 +51,7 @@ impl From<Options> for gix_dir::walk::Options {
emit_untracked: v.emit_untracked,
emit_empty_directories: v.emit_empty_directories,
classify_untracked_bare_repositories: v.classify_untracked_bare_repositories,
emit_collapsed: v.emit_collapsed,
}
}
}
Expand Down Expand Up @@ -106,4 +109,11 @@ impl Options {
self.classify_untracked_bare_repositories = toggle;
self
}

/// Control whether entries that are in an about-to-be collapsed directory will be emitted. The default is `None`,
/// so entries in a collapsed directory are not observable.
pub fn emit_collapsed(mut self, value: Option<CollapsedEntriesEmissionMode>) -> Self {
self.emit_collapsed = value;
self
}
}

0 comments on commit 87f710a

Please sign in to comment.