Fix .gitignore pattern mismatch in removePiLoopFromGitignore #46
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
When a user's
.gitignorecontains.pi-loop(without trailing slash),removePiLoopFromGitignore()fails to remove it because it only matches.pi-loop/(with trailing slash). This causesgit add -- . :(exclude).pi-loopin the MR stage to fail:Root Cause
src/run/services/gitExclude.ts—removePiLoopFromGitignore()uses exact match againstEXCLUDE_ENTRY = '.pi-loop/':.pi-loop≠.pi-loop/→ line stays in.gitignore→git addfails.Fix
Broaden
removePiLoopFromGitignore()to match three patterns:.pi-loop(no slash).pi-loop/(trailing slash — already handled)/.pi-loop(root-anchored)Acceptance Criteria
removePiLoopFromGitignore()removes lines matching.pi-loop,.pi-loop/, or/.pi-loop.pi-loopas a substring (e.g..pi-loop-extra/) are NOT removed.pi-loop(no slash) and/.pi-loop(root-anchored) removalnpm run lintandnpm testpassFiles to Change
src/run/services/gitExclude.ts— broaden pattern matchingsrc/run/services/gitExclude.test.ts— add two new tests, update substring safety testFixed in #47.