Skip to content

Commit 66db38d

Browse files
committed
Fix: --no-ignore should not un-ignore default ignores (fixes #5547)
1 parent 1beacc8 commit 66db38d

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

lib/ignored-paths.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,9 @@ function IgnoredPaths(options) {
114114
addPattern(this.ig.default, [".*", "!../"]);
115115
}
116116

117-
if (options.ignore !== false) {
118-
119-
addPattern(this.ig.default, this.defaultPatterns);
117+
addPattern(this.ig.default, this.defaultPatterns);
120118

119+
if (options.ignore !== false) {
121120
var ignorePath;
122121

123122
if (options.ignorePattern) {

tests/lib/ignored-paths.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -367,10 +367,10 @@ describe("IgnoredPaths", function() {
367367
assert.isTrue(ignoredPaths.contains(getFixturePath("node_modules/package/file.js")));
368368
});
369369

370-
it("should not apply defaultPatterns if ignore option is is false", function() {
370+
it("should still apply defaultPatterns if ignore option is is false", function() {
371371
var ignoredPaths = new IgnoredPaths({ ignore: false, cwd: getFixturePath() });
372-
assert.isFalse(ignoredPaths.contains(getFixturePath("bower_components/package/file.js")));
373-
assert.isFalse(ignoredPaths.contains(getFixturePath("node_modules/package/file.js")));
372+
assert.isTrue(ignoredPaths.contains(getFixturePath("bower_components/package/file.js")));
373+
assert.isTrue(ignoredPaths.contains(getFixturePath("node_modules/package/file.js")));
374374
});
375375

376376
it("should not ignore files in defaultPatterns within a subdirectory", function() {

0 commit comments

Comments
 (0)