Skip to content

UPSTREAM PR #2525: fix(status): ignore nested empty directory trees#44

Open
loci-dev wants to merge 1 commit intomainfrom
loci/pr-2525-fix-status-ignore-empty-dir-trees
Open

UPSTREAM PR #2525: fix(status): ignore nested empty directory trees#44
loci-dev wants to merge 1 commit intomainfrom
loci/pr-2525-fix-status-ignore-empty-dir-trees

Conversation

@loci-dev
Copy link
Copy Markdown

Note

Source pull request: GitoxideLabs/gitoxide#2525

Closes #2490

gix status treated directory trees that only contain empty directories as untracked because collapsing them dropped the EmptyDirectory property. That made gix status --submodules all report a clean submodule as modified when it only contained nested empty directories.

Before:

  • plain gix status showed ? empty/ for a repository that only had an empty directory tree
  • gix status --submodules all reported M config in the issue reproducer even though git status --short --ignore-submodules=none was clean

After:

  • collapsed directory trees that only contain empty directories keep the EmptyDirectory property
  • status skips those trees unless empty directories are explicitly requested

Validation:

  • cargo test -p gix-dir empty -- --nocapture
  • cargo test -p gix --test gix nested_empty_directories_are_ignored -- --nocapture
  • cargo test -p gix --test gix submodule_modification -- --nocapture
  • manual reproduction of #2490 before and after the fix

Propagate the empty-directory property when a collapsed directory only contains empty subdirectories so status keeps treating the whole tree as empty.

Add a regression fixture and status test for nested empty directory trees, and update the dirwalk expectation for collapsed empty-only directories.

Co-authored-by: OpenAI Codex <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants