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 | pub statistics: bool, | 41 | pub statistics: bool, |
| 42 | pub allow_write: bool, | 42 | pub allow_write: bool, |
| 43 | pub index_worktree_renames: Option<f32>, | 43 | pub index_worktree_renames: Option<f32>, |
| 44 | pub untracked: Option<gix::status::UntrackedFiles>, | ||
| 44 | } | 45 | } |
| 45 | 46 | ||
| 46 | pub fn show( | 47 | pub fn show( |
| @@ -58,6 +59,7 @@ pub fn show( · 11 unmodified lines | |||
| 58 | allow_write, | 59 | allow_write, |
| 59 | statistics, | 60 | statistics, |
| 60 | index_worktree_renames, | 61 | index_worktree_renames, |
| 62 | untracked, | ||
| 61 | }: Options, | 63 | }: Options, |
| 62 | ) -> anyhow::Result<()> { | 64 | ) -> anyhow::Result<()> { |
| 63 | if output_format != OutputFormat::Human { | 65 | if output_format != OutputFormat::Human { |
| @@ -70,9 +72,13 @@ pub fn show( · 6 unmodified lines | |||
| 70 | let start = std::time::Instant::now(); | 72 | let start = std::time::Instant::now(); |
| 71 | let prefix = repo.prefix()?.unwrap_or(Path::new("")); | 73 | let prefix = repo.prefix()?.unwrap_or(Path::new("")); |
| 72 | let index_progress = progress.add_child("traverse index"); | 74 | let index_progress = progress.add_child("traverse index"); |
| 73 | let mut iter = repo | 75 | let mut status = repo |
| 74 | .status(index_progress)? | 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 | .index_worktree_options_mut(|opts| { | 82 | .index_worktree_options_mut(|opts| { |
| 77 | if let Some((opts, ignored)) = opts.dirwalk_options.as_mut().zip(ignored) { | 83 | if let Some((opts, ignored)) = opts.dirwalk_options.as_mut().zip(ignored) { |
| 78 | opts.set_emit_ignored(Some(match ignored { | 84 | opts.set_emit_ignored(Some(match ignored { |