Fix renames of files that existed before we started watching on macOS #48
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
T-371 T-609
This fixes renames on macOS so that the delete event for the old name is properly emitted along with the create event for the new name. There was a test for this, but it only covered the case where the original file was created after we started watching. If the file already existed, only the create event for the new name would be emitted.
This removes the checking of our map to see if the file was created previously (obviously wrong 🙈). This does mean, however, that more unnecessary delete events will be emitted in the case of quick events (e.g. create + delete) because macOS coalesces events, but we will just ignore them anyway if they aren't in the graph.