fix: rtk find returns empty results after git init (#2589) by Saerdna · Pull Request #2598 · rtk-ai/rtk · GitHub
Skip to content

fix: rtk find returns empty results after git init (#2589)#2598

Open
Saerdna wants to merge 1 commit into
rtk-ai:developfrom
Saerdna:fix/issue-2589-find-after-git-init
Open

fix: rtk find returns empty results after git init (#2589)#2598
Saerdna wants to merge 1 commit into
rtk-ai:developfrom
Saerdna:fix/issue-2589-find-after-git-init

Conversation

@Saerdna

@Saerdna Saerdna commented Jun 25, 2026

Copy link
Copy Markdown

Summary

  • Fix rtk find returning empty results after git init (Bug: rtk find stops working after git init #2589)
  • Disable gitignore filtering (git_ignore/git_global/git_exclude) in WalkBuilder so rtk find matches native find behavior
  • Add regression test covering find in both non-git and git-initialized directories

Test plan

  • cargo clippy --all-targets && cargo test — 30/30 find_cmd tests pass, clippy clean
  • Manual testing: rtk find . -name "message.csv" returns correct results in git-initialized directory with global gitignore *.csv rule

Disable gitignore filtering in WalkBuilder so rtk find matches native
find behavior. Previously git_ignore/git_global/git_exclude were all
true, causing the ignore crate to respect .gitignore, global gitignore,
and .git/info/exclude rules. This incorrectly filtered out files that
are untracked or matched by global gitignore patterns (e.g. *.csv).

Root cause: ignore::WalkBuilder with git_global(true) reads the user's
global gitignore (e.g. ~/.config/git/ignore) and filters matching
files, even when no local .gitignore rule applies.

Regression test added: find_works_after_git_init creates a temp dir,
verifies find works before and after git init.
@CLAassistant

Copy link
Copy Markdown

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