MCPcopy Create free account
hub / github.com/alibaba/open-code-review / LoadGitignorePatterns

Function LoadGitignorePatterns

internal/diff/gitignore.go:14–17  ·  view source on GitHub ↗

LoadGitignorePatterns reads and parses .gitignore patterns from the given repository root. Returns nil if the file is missing or unreadable.

(repoDir string)

Source from the content-addressed store, hash-verified

12// LoadGitignorePatterns reads and parses .gitignore patterns from the given
13// repository root. Returns nil if the file is missing or unreadable.
14func LoadGitignorePatterns(repoDir string) []string {
15 stub := &Provider{repoDir: repoDir}
16 return stub.loadGitignorePatterns()
17}
18
19// IsPathExcluded returns true when relPath matches any of the supplied
20// gitignore-style patterns or any default excluded directory prefix

Callers 4

EnumerateMethod · 0.92
listFilesViaWalkMethod · 0.92
listWalkFilesMethod · 0.92

Calls 1

loadGitignorePatternsMethod · 0.95

Tested by 1