paulmillr/chokidar — pull request #60 by BonsaiDen (2013-10-18 17:51:40+00:00)
Title: Fix for unlink events on empty directories

Chokidar was emitting unlink events for empty directories, but it never emitted any other events for these, so they had the potential to confuse applications.

This also contains a fix where the `watched` object got cluttered with file paths in the `_remove` function, turns out that it always created a directory entry even if the path was a file, I made it so that in both cases the directory entry gets destroyed if it exists. This takes care of both cases (a file cluttering the object, and a directory being fully removed).

I also added a corresponding test case, please not that there's still one test failing, but that also happens on a fresh checkout from master.