This allows to control how untracked files are folded, but also can completely turn dirwalking off.
Showing the changes to gitoxide-core/src (1 of 3 files). Show all
Unified · Split
| @@ -41,6 +41,7 @@ pub struct Options { · 40 unmodified lines | ||
| 41 | 41 | pub statistics: bool, |
| 42 | 42 | pub allow_write: bool, |
| 43 | 43 | pub index_worktree_renames: Option<f32>, |
| 44 | + pub untracked: Option<gix::status::UntrackedFiles>, | |
| 44 | 45 | } |
| 45 | 46 | |
| 46 | 47 | pub fn show( |
| @@ -58,6 +59,7 @@ pub fn show( · 11 unmodified lines | ||
| 58 | 59 | allow_write, |
| 59 | 60 | statistics, |
| 60 | 61 | index_worktree_renames, |
| 62 | + untracked, | |
| 61 | 63 | }: Options, |
| 62 | 64 | ) -> anyhow::Result<()> { |
| 63 | 65 | if output_format != OutputFormat::Human { |
| @@ -70,9 +72,13 @@ pub fn show( · 6 unmodified lines | ||
| 70 | 72 | let start = std::time::Instant::now(); |
| 71 | 73 | let prefix = repo.prefix()?.unwrap_or(Path::new("")); |
| 72 | 74 | let index_progress = progress.add_child("traverse index"); |
| 73 | − let mut iter = repo | |
| 75 | + let mut status = repo | |
| 74 | 76 | .status(index_progress)? |
| 75 | − .should_interrupt_shared(&gix::interrupt::IS_INTERRUPTED) | |
| 77 | + .should_interrupt_shared(&gix::interrupt::IS_INTERRUPTED); | |
| 78 | + if let Some(untracked) = untracked { | |
| 79 | + status = status.untracked_files(untracked); | |
| 80 | + } | |
| 81 | + let mut iter = status | |
| 76 | 82 | .index_worktree_options_mut(|opts| { |
| 77 | 83 | if let Some((opts, ignored)) = opts.dirwalk_options.as_mut().zip(ignored) { |
| 78 | 84 | opts.set_emit_ignored(Some(match ignored { |