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

Function LoadGitignorePatterns

internal/diff/gitignore.go:31–34  ·  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

29// LoadGitignorePatterns reads and parses .gitignore patterns from the given
30// repository root. Returns nil if the file is missing or unreadable.
31func LoadGitignorePatterns(repoDir string) []string {
32 stub := &Provider{repoDir: repoDir}
33 return stub.loadGitignorePatterns()
34}
35
36// IsPathExcluded returns true when relPath matches any of the supplied
37// 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