MCPcopy
hub / github.com/codeaashu/claude-code / isPathGitignored

Function isPathGitignored

src/utils/git/gitignore.ts:23–37  ·  view source on GitHub ↗
(
  filePath: string,
  cwd: string,
)

Source from the content-addressed store, hash-verified

21 * @param cwd The working directory to run git from
22 */
23export async function isPathGitignored(
24 filePath: string,
25 cwd: string,
26): Promise<boolean> {
27 const { code } = await execFileNoThrowWithCwd(
28 'git',
29 ['check-ignore', filePath],
30 {
31 preserveOutputOnError: false,
32 cwd,
33 },
34 )
35
36 return code === 0
37}
38
39/**
40 * Gets the path to the global gitignore file (.config/git/ignore)

Callers 2

Calls 1

execFileNoThrowWithCwdFunction · 0.85

Tested by

no test coverage detected