diff --git a/lib/jekyll/entry_filter.rb b/lib/jekyll/entry_filter.rb index 272e7bbbbbc..49404a769be 100644 --- a/lib/jekyll/entry_filter.rb +++ b/lib/jekyll/entry_filter.rb @@ -92,6 +92,7 @@ def symlink_outside_site_source?(entry) # Returns true if path matches against any glob pattern, else false. def glob_include?(enumerator, entry) entry_with_source = PathManager.join(site.source, entry) + entry_is_directory = File.directory?(entry_with_source) enumerator.any? do |pattern| case pattern @@ -100,7 +101,7 @@ def glob_include?(enumerator, entry) File.fnmatch?(pattern_with_source, entry_with_source) || entry_with_source.start_with?(pattern_with_source) || - (pattern_with_source == "#{entry_with_source}/" if File.directory?(entry_with_source)) + (pattern_with_source == "#{entry_with_source}/" if entry_is_directory) when Regexp pattern.match?(entry_with_source) else