Skip to content

Commit

Permalink
Filter unlinks in case of intersecting globs
Browse files Browse the repository at this point in the history
  • Loading branch information
es128 committed Mar 10, 2015
1 parent 539d792 commit 2ab2488
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/nodefs-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,12 +378,13 @@ function(dir, stats, initialAdd, depth, target, wh, callback) {
// Files that absent in current directory snapshot
// but present in previous emit `remove` event
// and are removed from @watched[directory].
previous.children().filter(function(item) {
previous.children().filter(wh.globFilter || function() {
return true;
}).filter(function(item) {
return item !== directory && current.indexOf(item) === -1;
}).forEach(function(item) {
this._remove(directory, item);
}, this);

}.bind(this)).on('error', this._handleError.bind(this));
}.bind(this);

Expand Down

0 comments on commit 2ab2488

Please sign in to comment.