summaryrefslogtreecommitdiff
path: root/lib/chef/chef_fs/file_system.rb
diff options
context:
space:
mode:
authorjkeiser <jkeiser@opscode.com>2013-01-02 16:28:06 -0800
committerJohn Keiser <jkeiser@opscode.com>2013-06-07 13:12:14 -0700
commit767205d191adf968d2ffd28e6498f5e663fafe06 (patch)
tree1554898ccbe11f670b60970ad748f6e49f7fd6e6 /lib/chef/chef_fs/file_system.rb
parentb9af27b2bec003fcf2d8ecf75a980aa6f72f0467 (diff)
downloadchef-767205d191adf968d2ffd28e6498f5e663fafe06.tar.gz
Always return exact matches (let the caller decide if they exist)
Diffstat (limited to 'lib/chef/chef_fs/file_system.rb')
-rw-r--r--lib/chef/chef_fs/file_system.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/chef_fs/file_system.rb b/lib/chef/chef_fs/file_system.rb
index 9ce4a23254..26183538c5 100644
--- a/lib/chef/chef_fs/file_system.rb
+++ b/lib/chef/chef_fs/file_system.rb
@@ -35,7 +35,7 @@ class Chef
block.call(entry)
end
- if entry.dir? && pattern.could_match_children?(entry.path)
+ if pattern.could_match_children?(entry.path)
# If it's possible that our children could match, descend in and add matches.
exact_child_name = pattern.exact_child_name_under(entry.path)
@@ -48,7 +48,7 @@ class Chef
end
# Otherwise, go through all children and find any matches
- else
+ elsif entry.dir?
entry.children.each do |child|
list(child, pattern, &block)
end