History

feat: add `gix status --untracked` flag

This allows to control how untracked files are folded, but also can completely turn dirwalking off.

GPT 5.5 committed 4 months ago

Commit 9316ff81 parent d8aeaac3 files · +30 −2Browse files

Showing the changes to gitoxide-core/src (1 of 3 files). Show all

Unified · Split

gitoxide-core/src/repository/status.rs+8−2
@@ -41,6 +41,7 @@ pub struct Options { · 40 unmodified lines
4141 pub statistics: bool,
4242 pub allow_write: bool,
4343 pub index_worktree_renames: Option<f32>,
44+ pub untracked: Option<gix::status::UntrackedFiles>,
4445 }
4546
4647 pub fn show(
@@ -58,6 +59,7 @@ pub fn show( · 11 unmodified lines
5859 allow_write,
5960 statistics,
6061 index_worktree_renames,
62+ untracked,
6163 }: Options,
6264 ) -> anyhow::Result<()> {
6365 if output_format != OutputFormat::Human {
@@ -70,9 +72,13 @@ pub fn show( · 6 unmodified lines
7072 let start = std::time::Instant::now();
7173 let prefix = repo.prefix()?.unwrap_or(Path::new(""));
7274 let index_progress = progress.add_child("traverse index");
73− let mut iter = repo
75+ let mut status = repo
7476 .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
7682 .index_worktree_options_mut(|opts| {
7783 if let Some((opts, ignored)) = opts.dirwalk_options.as_mut().zip(ignored) {
7884 opts.set_emit_ignored(Some(match ignored {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t