fix: broaden .gitignore pattern matching in removePiLoopFromGitignore #47

Merged
david merged 1 commit from issue-46/fix-gitignore-pattern-mismatch into main 2026-07-30 00:47:48 +00:00
Owner

Summary

removePiLoopFromGitignore() only matched .pi-loop/ (with trailing slash), so lines with .pi-loop (no slash) or /.pi-loop (root-anchored) were not removed. This caused git add -- . :(exclude).pi-loop to fail in the MR stage.

Changes

  • Added PILOOP_GITIGNORE_PATTERNS with three variants: .pi-loop, .pi-loop/, /.pi-loop
  • Added isPiLoopGitignoreLine() helper for explicit allowlist matching
  • Updated removePiLoopFromGitignore() to use the new helper
  • Added 2 new tests for .pi-loop (no slash) and /.pi-loop (root-anchored) removal
  • Updated substring-safety test to cover .pi-loop-extra/ and .pi-loop-backup

Testing

  • All 865 tests pass (2 new + 1 updated)
  • Full test suite run with no regressions
  • npm run lint clean
  • npm run build clean

Checklist

  • Self-reviewed the diff
  • Code follows project conventions
  • Descriptive naming (no single-character variables)
## Summary `removePiLoopFromGitignore()` only matched `.pi-loop/` (with trailing slash), so lines with `.pi-loop` (no slash) or `/.pi-loop` (root-anchored) were not removed. This caused `git add -- . :(exclude).pi-loop` to fail in the MR stage. ## Changes - Added `PILOOP_GITIGNORE_PATTERNS` with three variants: `.pi-loop`, `.pi-loop/`, `/.pi-loop` - Added `isPiLoopGitignoreLine()` helper for explicit allowlist matching - Updated `removePiLoopFromGitignore()` to use the new helper - Added 2 new tests for `.pi-loop` (no slash) and `/.pi-loop` (root-anchored) removal - Updated substring-safety test to cover `.pi-loop-extra/` and `.pi-loop-backup` ## Testing - [x] All 865 tests pass (2 new + 1 updated) - [x] Full test suite run with no regressions - [x] `npm run lint` clean - [x] `npm run build` clean ## Checklist - [ ] Self-reviewed the diff - [ ] Code follows project conventions - [ ] Descriptive naming (no single-character variables)
removePiLoopFromGitignore() only matched '.pi-loop/' (with trailing slash),
so lines with '.pi-loop' (no slash) or '/.pi-loop' (root-anchored) were
not removed. This caused git add -- . :(exclude).pi-loop to fail in the
MR stage.

Now matches all three variants via an explicit allowlist of trimmed line
patterns, while still preserving substring-safety (e.g. '.pi-loop-extra/'
is not removed).

Closes #46
david merged commit 3a7dc12b35 into main 2026-07-30 00:47:48 +00:00
david deleted branch issue-46/fix-gitignore-pattern-mismatch 2026-07-30 00:47:48 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
david/pi-loop!47
No description provided.