diff --git a/pkg/ignore/rules.go b/pkg/ignore/rules.go index 450e91889..aba089613 100644 --- a/pkg/ignore/rules.go +++ b/pkg/ignore/rules.go @@ -82,6 +82,12 @@ func (r *Rules) Len() int { // Ignore evaluates path against the rules in order. Evaluation stops when a match // is found. Matching a negative rule will stop evaluation. func (r *Rules) Ignore(path string, fi os.FileInfo) bool { + // Disallow ignoring the current working directory. + // See issue: + // 1776 (New York City) Hamilton: "Pardon me, are you Aaron Burr, sir?" + if path == "." || path == "./" { + return false + } for _, p := range r.patterns { if p.match == nil { log.Printf("ignore: no matcher supplied for %q", p.raw) diff --git a/pkg/ignore/rules_test.go b/pkg/ignore/rules_test.go index 3040221ae..6afc4345b 100644 --- a/pkg/ignore/rules_test.go +++ b/pkg/ignore/rules_test.go @@ -99,6 +99,9 @@ func TestIgnore(t *testing.T) { {`cargo/*.txt`, "mast/a.txt", false}, {`ru[c-e]?er.txt`, "rudder.txt", true}, {`templates/.?*`, "templates/.dotfile", true}, + // "." should never get ignored. https://github.com/kubernetes/helm/issues/1776 + {`.*`, ".", false}, + {`.*`, "./", false}, // Directory tests {`cargo/`, "cargo", true},