* Checks if a path is a git-internal path (HEAD, objects/, refs/, hooks/).
(path: string)
| 1779 | * Checks if a path is a git-internal path (HEAD, objects/, refs/, hooks/). |
| 1780 | */ |
| 1781 | function isGitInternalPath(path: string): boolean { |
| 1782 | // Normalize path by removing leading ./ or / |
| 1783 | const normalized = path.replace(/^\.?\//, '') |
| 1784 | return GIT_INTERNAL_PATTERNS.some(pattern => pattern.test(normalized)) |
| 1785 | } |
| 1786 | |
| 1787 | // Commands that only delete or modify in-place (don't create new files at new paths) |
| 1788 | const NON_CREATING_WRITE_COMMANDS = new Set(['rm', 'rmdir', 'sed']) |
no outgoing calls
no test coverage detected