fix: detect .worktrees/ ignore via git check-ignore#2
Merged
IamGroooooot merged 1 commit intoApr 28, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.gitignore-grep guard for the default.worktrees/root with agit check-ignorequery, so global excludes and.git/info/excludecount as valid.git/info/excludepath that was previously rejectedChanges
cwt.sh:_cwt_ensure_default_worktree_ignorednow delegates togit -C "$git_root" check-ignore -q .worktrees/, dropping the literal.gitignoreregex scan.gitignore" / "Refusing to edit.gitignoreautomatically" to "to be gitignored (local, global, or info/exclude)" / "Add.worktrees/to your gitignore and rerun"tests/cwt_new.bats: update the existing rejection assertions to the new strings; addaccepts .worktrees/ ignored via .git/info/excludecovering the new code pathREADME.md/README.ko.md: clarify that any gitignore source (repo.gitignore,.git/info/exclude, global excludes) satisfies the requirementTest plan
npx bats tests/cwt_new.bats— 44/44 passing, including the new.git/info/excludecase.gitignore+ globalcore.excludesFilelisting.worktrees/→cwt newproceeds.git/info/excludeonly →cwt newproceeds.worktrees/→ blocked with the new message