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

Function LoadGitignorePatterns

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

15// LoadGitignorePatterns reads and parses .gitignore patterns from the given
16// repository root. Returns nil if the file is missing or unreadable.
17func LoadGitignorePatterns(repoDir string) []string {
18 stub := &Provider{repoDir: repoDir}
19 return stub.loadGitignorePatterns()
20}
21
22// IsPathExcluded returns true when relPath matches any of the supplied
23// 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