   #
   # Returns {Boolean} true if the file is accepted
   isFileAccepted: (filepath) ->
-    @isPathAccepted('directory', filepath) and @isPathAccepted('file', filepath)
+    @isDirectoryAccepted(filepath) and @isPathAccepted('file', filepath)
 
   # Public: Test if the `filepath` is accepted as a directory based on the
   # constructing options.


    @inclusions = @createMatchers(inclusions, true)
    @exclusions = @createMatchers(exclusions, false)

    @repo = GitUtils.open(rootPath) if excludeVcsIgnores


  #
  # Returns {Boolean} true if the directory is accepted
  isDirectoryAccepted: (filepath) ->
    return false if @isPathExcluded('directory', filepath) is true

    # An matching explicit local inclusion will override the global exclusions
    # Other than this, the logic is the same between file and directory matching.
    return true if @inclusions['directory']?.length && @isPathIncluded('directory', filepath)

    @isPathIncluded('directory', filepath) &&
    !@isPathGloballyExcluded('directory', filepath)

  isPathAccepted: (fileOrDirectory, filepath) ->
    !@isPathExcluded(fileOrDirectory, filepath) &&
    @isPathIncluded(fileOrDirectory, filepath) &&
    !@isPathGloballyExcluded(fileOrDirectory, filepath)

  ###
  Section: Private Methods
  ###

  isPathIncluded: (fileOrDirectory, filepath) ->
    inclusions = @inclusions[fileOrDirectory]
    return true unless inclusions?.length

    index = inclusions.length
    while index--
      return true if inclusions[index].match(filepath)
    return false

  isPathExcluded: (fileOrDirectory, filepath) ->
    return true if @repo?.isIgnored(@repo.relativize(filepath))
    exclusions = @exclusions[fileOrDirectory]
    return false unless exclusions?.length

    index = exclusions.length
    while index--
      return true if (exclusions[index].match(filepath))
    return false

  isPathGloballyExcluded: (fileOrDirectory, filepath) ->
    return true if @repo?.isIgnored(@repo.relativize(filepath))

    exclusions = @globalExclusions[fileOrDirectory]
    index = exclusions.length
    while index--
      return true if (exclusions[index].match(filepath))
    return false

  sanitizePaths: (options) ->
