The negation pattern logic in Ignore() was broken in two ways:
1. Inverted logic: when a file did NOT match a negation pattern, the
function incorrectly returned true (ignore the file)
2. Early termination: the function returned immediately on the first
matching rule, preventing later negation rules from overriding
earlier exclusion rules
This caused critical files like Chart.yaml to be incorrectly ignored
when any negation pattern existed in .helmignore, breaking helm lint,
helm template, and helm install with 'Chart.yaml file is missing'.
The fix rewrites Ignore() to follow proper gitignore semantics:
- Process all rules in order, tracking the ignore state
- The last matching rule wins
- Negation patterns set ignored=false when they match
- Regular patterns set ignored=true when they match
Example .helmignore that now works correctly:
*.md
!README.md
Before: Chart.yaml was incorrectly ignored
After: Only .md files (except README.md) are ignored
Signed-off-by: Mats Willemsen <mats.willemsen@ah.nl>