This commit is contained in:
Luna 2025-06-10 22:16:25 -03:00
parent cd1f23527e
commit ed8a6f2d81

View file

@ -43,7 +43,7 @@ type GitIgnore struct {
// NewGitIgnore creates a new GitIgnore parser by reading .gitignore file
func NewGitIgnore() (*GitIgnore, error) {
gi := &GitIgnore{}
file, err := os.Open(".gitignore")
if err != nil {
if os.IsNotExist(err) {
@ -104,7 +104,7 @@ func (gi *GitIgnore) matchPattern(pattern, path string) bool {
// Check if pattern matches any suffix of the path
pathParts := strings.Split(path, string(filepath.Separator))
patternParts := strings.Split(pattern, "/")
if len(patternParts) <= len(pathParts) {
for i := 0; i <= len(pathParts)-len(patternParts); i++ {
match := true