MCPcopy Create free account
hub / github.com/codeaashu/claude-code / isGitInternalPath

Function isGitInternalPath

src/tools/BashTool/readOnlyValidation.ts:1781–1785  ·  view source on GitHub ↗

* Checks if a path is a git-internal path (HEAD, objects/, refs/, hooks/).

(path: string)

Source from the content-addressed store, hash-verified

1779 * Checks if a path is a git-internal path (HEAD, objects/, refs/, hooks/).
1780 */
1781function 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)
1788const NON_CREATING_WRITE_COMMANDS = new Set(['rm', 'rmdir', 'sed'])

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected