diff --git a/internal/fingerprint/gitignore.go b/internal/fingerprint/gitignore.go index f8d75176..e74bc716 100644 --- a/internal/fingerprint/gitignore.go +++ b/internal/fingerprint/gitignore.go @@ -64,11 +64,14 @@ func readGitignoreLines(path string) []string { var lines []string scanner := bufio.NewScanner(f) for scanner.Scan() { - line := scanner.Text() + line := strings.TrimRight(scanner.Text(), "\r") if line != "" && !strings.HasPrefix(line, "#") { lines = append(lines, line) } } + if err := scanner.Err(); err != nil { + return nil + } return lines } diff --git a/taskfile/ast/task.go b/taskfile/ast/task.go index c9d2c207..9465c777 100644 --- a/taskfile/ast/task.go +++ b/taskfile/ast/task.go @@ -76,8 +76,8 @@ func (t *Task) IsSilent() bool { return t.Silent != nil && *t.Silent } -// ShouldUseGitignore returns true if the task has gitignore filtering explicitly enabled. -// Returns false if UseGitignore is nil (not set) or explicitly set to false. +// ShouldUseGitignore returns true if gitignore filtering is enabled for the task. +// Returns false if UseGitignore is nil or set to false. func (t *Task) ShouldUseGitignore() bool { return t.UseGitignore != nil && *t.UseGitignore }