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

Method loadGitignorePatterns

internal/diff/git.go:284–290  ·  view source on GitHub ↗

loadGitignorePatterns reads and parses .gitignore patterns from the repo root.

()

Source from the content-addressed store, hash-verified

282
283// loadGitignorePatterns reads and parses .gitignore patterns from the repo root.
284func (p *Provider) loadGitignorePatterns() []string {
285 data, err := os.ReadFile(filepath.Join(p.repoDir, ".gitignore"))
286 if err != nil {
287 return nil
288 }
289 return parseGitignorePatterns(data)
290}
291
292func parseGitignorePatterns(data []byte) GitignorePatterns {
293 var patterns GitignorePatterns

Callers 2

untrackedFilesListMethod · 0.95
LoadGitignorePatternsFunction · 0.95

Calls 1

parseGitignorePatternsFunction · 0.85

Tested by

no test coverage detected