MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / isPathGitignored

Function isPathGitignored

source code/utils/git/gitignore.ts:25–39  ·  view source on GitHub ↗
(
  filePath: string,
  cwd: string,
)

Source from the content-addressed store, hash-verified

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

Callers 2

Calls 1

execFileNoThrowWithCwdFunction · 0.85

Tested by

no test coverage detected