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

Function parseGitignorePatterns

internal/diff/git.go:292–302  ·  view source on GitHub ↗
(data []byte)

Source from the content-addressed store, hash-verified

290}
291
292func parseGitignorePatterns(data []byte) GitignorePatterns {
293 var patterns GitignorePatterns
294 for line := range strings.SplitSeq(string(data), "\n") {
295 line = strings.TrimSpace(line)
296 if line == "" || strings.HasPrefix(line, "#") {
297 continue
298 }
299 patterns = append(patterns, line)
300 }
301 return patterns
302}
303
304// isPathExcluded returns true when the given relative file path should be skipped
305// based on hardcoded dir rules or .gitignore patterns.

Callers 2

loadGitignorePatternsMethod · 0.85
LoadGitignoreAtRefFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected