# File lib/grit/git-ruby/file_index.rb, line 95
    def last_commits(commit_sha, files_matcher)
      acceptable = commits_from(commit_sha)

      matches = {}

      if files_matcher.is_a? Regexp
        files = @all_files.keys.select { |file| file =~ files_matcher }
        files_matcher = files
      end

      if files_matcher.is_a? Array
        # find the last commit for each file in the array
        files_matcher.each do |f|
          @all_files[f].each do |try|
            if acceptable.include?(try)
              matches[f] = try
              break
            end
          end if @all_files[f]
        end
      end

      matches
    end