Merge pull request #821 from Tibsfox/fix/config-and-path-corrections

Clean surgical fix - adds --no-index to git check-ignore for correct .gitignore handling of tracked files
This commit is contained in:
TÂCHES
2026-03-02 16:14:38 -06:00
committed by GitHub

View File

@@ -124,7 +124,11 @@ function loadConfig(cwd) {
function isGitIgnored(cwd, targetPath) {
try {
execSync('git check-ignore -q -- ' + targetPath.replace(/[^a-zA-Z0-9._\-/]/g, ''), {
// --no-index checks .gitignore rules regardless of whether the file is tracked.
// Without it, git check-ignore returns "not ignored" for tracked files even when
// .gitignore explicitly lists them — a common source of confusion when .planning/
// was committed before being added to .gitignore.
execSync('git check-ignore -q --no-index -- ' + targetPath.replace(/[^a-zA-Z0-9._\-/]/g, ''), {
cwd,
stdio: 'pipe',
});