Skip to content

Commit

Permalink
Merge pull request #309 from guard/e2-dont_clobber_record
Browse files Browse the repository at this point in the history
do not modify Record hash returned by dir_entries
  • Loading branch information
e2 committed May 6, 2015
2 parents cba1e51 + 3003838 commit e639493
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/listen/directory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def self.scan(queue, sync_record, dir, rel_path, options)
end

# TODO: this is not tested properly
previous.reject! { |entry, _| current.include? path + entry }
previous = previous.reject { |entry, _| current.include? path + entry }

_async_changes(dir, rel_path, queue, previous, options)

Expand Down
2 changes: 1 addition & 1 deletion spec/lib/listen/directory_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

context 'with file & subdir in record' do
let(:record_entries) do
{ 'file.rb' => { mtime: 1.1 }, 'subdir' => {} }
{ 'file.rb' => { mtime: 1.1 }, 'subdir' => {} }.freeze
end

context 'with empty dir' do
Expand Down

0 comments on commit e639493

Please sign in to comment.