         addFileMatcher(matchers, pattern)
 
     matchers
+
+  containsPattern: (matchers, fileOrDirectory, pattern) ->
+    for matcher in matchers[fileOrDirectory]
+      return true if matcher.pattern is pattern
+    false

    @exclusions.file.push(matcher)
    @exclusions.directory.push(matcher)

  createMatchers: (patterns=[], deepMatch) ->
    addFileMatcher = (matchers, pattern) ->
      matchers.file.push(new Minimatch(pattern, PathFilter.MINIMATCH_OPTIONS))

    addDirectoryMatcher = (matchers, pattern, deepMatch) ->
      # It is important that we keep two permutations of directory patterns:
      #
      # * 'directory/anotherdir'

    {includeHidden, excludeVcsIgnores} = options
    {inclusions, exclusions, globalExclusions} = @sanitizePaths(options)

    @inclusions = @createMatchers(inclusions, {deepMatch: true})
    @exclusions = @createMatchers(exclusions, {deepMatch: false})
    @globalExclusions = @createMatchers(globalExclusions, {deepMatch: false, disallowDuplicatesFrom: @inclusions})

    @repo = GitUtils.open(rootPath) if excludeVcsIgnores

