<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -8,7 +8,7 @@ module Grit
   # if it will be faster, or if the git binary is not available (!!TODO!!)
   module GitRuby
     
-    attr_accessor :ruby_git_repo
+    attr_accessor :ruby_git_repo, :git_file_index
     
     def cat_file(options, ref)
       if options[:t]
@@ -34,8 +34,15 @@ module Grit
     def rev_list(options, ref = 'master')
       options.delete(:skip) if options[:skip].to_i == 0
       allowed_options = [:max_count, :since, :until, :pretty]  # this is all I can do right now
-      if (options.size == 0) || ((options.keys - allowed_options).size &gt; 0)
+      if ((options.keys - allowed_options).size &gt; 0)
         return method_missing('rev-list', options, ref)
+      elsif (options.size == 0)
+        # pure rev-list
+        begin
+          return file_index.commits_from(rev_parse({}, ref)).join(&quot;\n&quot;)
+        rescue
+          return method_missing('rev-list', options, ref) 
+        end
       else
         return ruby_git.rev_list(rev_parse({}, ref), options)      
       end
@@ -76,16 +83,18 @@ module Grit
     end
     
     def blame_tree(commit, path = nil)
-      begin # try index file, sooooo much faster
-        index = FileIndex.new(@git_dir)
-        commits = index.last_commits(commit, looking_for(commit, path))
-        clean_paths(commits, path)
-      rescue
-        temp = Repository.new(@git_dir, :map_packfile =&gt; true)
-        temp.blame_tree(rev_parse({}, commit), path)
+      begin
+        commits = file_index.last_commits(rev_parse({}, commit), looking_for(commit, path))
+        clean_paths(commits)
+      rescue FileIndex::IndexFileNotFound
+        {}
       end
     end
     
+    def file_index
+      @git_file_index ||= FileIndex.new(@git_dir)
+    end
+    
     def ruby_git
       @ruby_git_repo ||= Repository.new(@git_dir)
     end
@@ -102,19 +111,17 @@ module Grit
           else
             file = e.name
           end
+          file += '/' if e.type == :directory
           looking_for &lt;&lt; file
         end
         looking_for
       end
     
-      def clean_paths(commit_array, path)
-        return commit_array if !path || (path == '' || path == '.' || path == './')
-        
+      def clean_paths(commit_array)
         new_commits = {}
-        path_match = Regexp.new(path + '/')
         commit_array.each do |file, sha|
-          amended = file.sub(path_match, '')
-          new_commits[amended] = sha
+          file = file.chop if file[file.size - 1 , 1] == '/'
+          new_commits[file] = sha
         end
         new_commits
       end</diff>
      <filename>lib/grit/git-ruby.rb</filename>
    </modified>
    <modified>
      <diff>@@ -58,7 +58,7 @@ module Grit
         commit = @commit_index[commit_sha]
         commit[:parents].each do |sha|
           left_to_do &lt;&lt; sha
-        end
+        end if commit
       end
 
       final
@@ -119,6 +119,13 @@ module Grit
             @sha_count += 1
           else
             file_name = line.chomp
+            tree = ''
+            File.dirname(file_name).split('/').each do |part|
+              next if part == '.'
+              tree += part + '/'
+              @all_files[tree] ||= []
+              @all_files[tree].unshift(current_sha)
+            end
             @all_files[file_name] ||= []
             @all_files[file_name].unshift(current_sha)
             @commit_index[current_sha][:files] &lt;&lt; file_name
@@ -136,9 +143,12 @@ end
 
 if __FILE__ == $0
   
-  repo = '/Users/schacon/projects/git/.git'
-  commit = 'd8933f013a66cc1deadf83a9c24eccb6fee78a35'
-  file_list = [&quot;builtin-merge-recursive.c&quot;, &quot;git-send-email-script&quot;, &quot;git-parse-remote.sh&quot;, &quot;builtin-add.c&quot;, &quot;merge-base.c&quot;, &quot;read-cache.c&quot;, &quot;fsck.h&quot;, &quot;diff.c&quot;, &quot;refs.c&quot;, &quot;diffcore-rename.c&quot;, &quot;epoch.c&quot;, &quot;pack-intersect.c&quot;, &quot;fast-import.c&quot;, &quot;git-applypatch.sh&quot;, &quot;git.spec.in&quot;, &quot;rpush.c&quot;, &quot;git-clone-script&quot;, &quot;utf8.c&quot;, &quot;git-external-diff-script&quot;, &quot;builtin-init-db.c&quot;, &quot;pack-redundant.c&quot;, &quot;builtin-diff-index.c&quot;, &quot;index.c&quot;, &quot;update-index.c&quot;, &quot;fetch-clone.c&quot;, &quot;pager.c&quot;, &quot;diff.h&quot;, &quot;unpack-trees.c&quot;, &quot;git-browse-help.sh&quot;, &quot;git-rename-script&quot;, &quot;refs.h&quot;, &quot;get-tar-commit-id.c&quot;, &quot;git-push.sh&quot;, &quot;README&quot;, &quot;delta.c&quot;, &quot;mailsplit.c&quot;, &quot;gitweb.cgi&quot;, &quot;var.c&quot;, &quot;epoch.h&quot;, &quot;gsimm.c&quot;, &quot;archive.c&quot;, &quot;sideband.c&quot;, &quot;utf8.h&quot;, &quot;local-fetch.c&quot;, &quot;git-request-pull-script&quot;, &quot;builtin-send-pack.c&quot;, &quot;blob.c&quot;, &quot;builtin-ls-remote.c&quot;, &quot;pretty.c&quot;, &quot;git-diff.sh&quot;, &quot;diffcore-break.c&quot;, &quot;unpack-trees.h&quot;, &quot;git-mv.perl&quot;, &quot;interpolate.c&quot;, &quot;builtin-diff-files.c&quot;, &quot;delta.h&quot;, &quot;commit-tree.c&quot;, &quot;git-diff-script&quot;, &quot;decorate.c&quot;, &quot;builtin-name-rev.c&quot;, &quot;tree-walk.c&quot;, &quot;git-revert-script&quot;, &quot;git-sh-setup.sh&quot;, &quot;transport.c&quot;, &quot;gsimm.h&quot;, &quot;archive.h&quot;, &quot;count-delta.c&quot;, &quot;sideband.h&quot;, &quot;git-merge.sh&quot;, &quot;git-gui.sh&quot;, &quot;git-core.spec.in&quot;, &quot;cvs2git.c&quot;, &quot;blob.h&quot;, &quot;git.sh&quot;, &quot;http-push.c&quot;, &quot;builtin-commit-tree.c&quot;, &quot;diff-helper.c&quot;, &quot;builtin-push.c&quot;, &quot;interpolate.h&quot;, &quot;decorate.h&quot;, &quot;git-citool&quot;, &quot;dotest&quot;, &quot;builtin-verify-tag.c&quot;, &quot;git-mergetool.sh&quot;, &quot;tree-walk.h&quot;, &quot;log-tree.c&quot;, &quot;name-rev.c&quot;, &quot;applypatch&quot;, &quot;cat-file.c&quot;, &quot;test-delta.c&quot;, &quot;server-info.c&quot;, &quot;count-delta.h&quot;, &quot;write-tree.c&quot;, &quot;local-pull.c&quot;, &quot;transport.h&quot;, &quot;git-rm.sh&quot;, &quot;unpack-objects.c&quot;, &quot;xdiff-interface.c&quot;, &quot;git-repack-script&quot;, &quot;commit.c&quot;, &quot;hash-object.c&quot;, &quot;git-merge-recursive.py&quot;, &quot;git-clone-dumb-http&quot;, &quot;thread-utils.c&quot;, &quot;git-send-email.perl&quot;, &quot;git-whatchanged.sh&quot;, &quot;log-tree.h&quot;, &quot;builtin-annotate.c&quot;, &quot;show-index.c&quot;, &quot;pkt-line.c&quot;, &quot;ident.c&quot;, &quot;git-rebase-script&quot;, &quot;name-hash.c&quot;, &quot;git-archimport.perl&quot;, &quot;xdiff-interface.h&quot;, &quot;commit.h&quot;, &quot;diff-lib.c&quot;, &quot;wt-status.c&quot;, &quot;base85.c&quot;, &quot;builtin-fetch--tool.c&quot;, &quot;unpack-file.c&quot;, &quot;builtin-diff-stages.c&quot;, &quot;merge-index.c&quot;, &quot;color.c&quot;, &quot;diff-tree.c&quot;, &quot;git-checkout.sh&quot;, &quot;thread-utils.h&quot;, &quot;grep.c&quot;, &quot;pkt-line.h&quot;, &quot;builtin-help.c&quot;, &quot;test-parse-options.c&quot;, &quot;show-files.c&quot;, &quot;git.sh.in&quot;, &quot;pack.h&quot;, &quot;wt-status.h&quot;, &quot;git-prune-script&quot;, &quot;test-sha1.c&quot;, &quot;git-octopus.sh&quot;, &quot;dump-cache-tree.c&quot;, &quot;git-web--browse.sh&quot;, &quot;builtin-upload-tar.c&quot;, &quot;builtin-clone.c&quot;, &quot;copy.c&quot;, &quot;color.h&quot;, &quot;show-branch.c&quot;, &quot;peek-remote.c&quot;, &quot;git-merge-recursive-old.py&quot;, &quot;cmd-rename.sh&quot;, &quot;git-apply-patch-script&quot;, &quot;git-export.c&quot;, &quot;git-relink-script&quot;, &quot;grep.h&quot;, &quot;usage.c&quot;, &quot;git-fetch-dumb-http&quot;, &quot;fsck-objects.c&quot;, &quot;update-cache.c&quot;, &quot;diff-stages.c&quot;, &quot;patch-ids.c&quot;, &quot;builtin-rev-list.c&quot;, &quot;builtin-bundle.c&quot;, &quot;builtin-show-branch.c&quot;, &quot;builtin-pack-refs.c&quot;, &quot;tree.c&quot;, &quot;git.c&quot;, &quot;verify_pack.c&quot;, &quot;update-ref.c&quot;, &quot;builtin-peek-remote.c&quot;, &quot;diffcore-pathspec.c&quot;, &quot;git-merge-octopus.sh&quot;, &quot;git-show-branches-script&quot;, &quot;builtin-archive.c&quot;, &quot;builtin-unpack-objects.c&quot;, &quot;git-rerere.perl&quot;, &quot;walker.c&quot;, &quot;builtin-mailsplit.c&quot;, &quot;convert.c&quot;, &quot;builtin-branch.c&quot;, &quot;export.c&quot;, &quot;patch-ids.h&quot;, &quot;check-builtins.sh&quot;, &quot;git-pull-script&quot;, &quot;tree.h&quot;, &quot;alloc.c&quot;, &quot;git-commit.sh&quot;, &quot;git-lost-found.sh&quot;, &quot;mailmap.c&quot;, &quot;rsh.c&quot;, &quot;exec_cmd.c&quot;, &quot;git-compat-util.h&quot;, &quot;ws.c&quot;, &quot;rev-list.c&quot;, &quot;git-verify-tag.sh&quot;, &quot;git-ls-remote-script&quot;, &quot;mktree.c&quot;, &quot;walker.h&quot;, &quot;builtin-blame.c&quot;, &quot;builtin-fsck.c&quot;, &quot;setup.c&quot;, &quot;git-cvsimport-script&quot;, &quot;git-add.sh&quot;, &quot;symlinks.c&quot;, &quot;checkout-index.c&quot;, &quot;receive-pack.c&quot;, &quot;git-merge-one-file-script&quot;, &quot;mailmap.h&quot;, &quot;git-cvsimport.perl&quot;, &quot;builtin-count.c&quot;, &quot;exec_cmd.h&quot;, &quot;builtin-stripspace.c&quot;, &quot;git-grep.sh&quot;, &quot;hash.c&quot;, &quot;builtin-prune-packed.c&quot;, &quot;git-rebase--interactive.sh&quot;, &quot;rsh.h&quot;, &quot;match-trees.c&quot;, &quot;git-format-patch.sh&quot;, &quot;git-push-script&quot;, &quot;parse-options.c&quot;, &quot;git-status-script&quot;, &quot;http-walker.c&quot;, &quot;pack-write.c&quot;, &quot;git-status.sh&quot;, &quot;diff-delta.c&quot;, &quot;hash.h&quot;, &quot;generate-cmdlist.sh&quot;, &quot;config-set.c&quot;, &quot;builtin-fetch.c&quot;, &quot;ll-merge.c&quot;, &quot;t1300-config-set.sh&quot;, &quot;ls-tree.c&quot;, &quot;write_or_die.c&quot;, &quot;builtin-check-ref-format.c&quot;, &quot;fetch-pack.c&quot;, &quot;git-commit-script&quot;, &quot;builtin-describe.c&quot;, &quot;parse-options.h&quot;, &quot;builtin-checkout.c&quot;, &quot;prune-packed.c&quot;, &quot;fixup-builtins&quot;, &quot;http-fetch.c&quot;, &quot;test-absolute-path.c&quot;, &quot;git-log.sh&quot;, &quot;builtin-merge-ours.c&quot;, &quot;git-whatchanged&quot;, &quot;pull.c&quot;, &quot;merge-tree.c&quot;, &quot;ll-merge.h&quot;, &quot;builtin.h&quot;, &quot;Makefile&quot;, &quot;cache-tree.c&quot;, &quot;builtin-log.c&quot;, &quot;merge-cache.c&quot;, &quot;fetch-pack.h&quot;, &quot;git-shortlog.perl&quot;, &quot;git-bisect-script&quot;, &quot;git-am.sh&quot;, &quot;check-ref-format.c&quot;, &quot;git-count-objects-script&quot;, &quot;mkdelta.c&quot;, &quot;builtin-diff.c&quot;, &quot;merge-recursive.c&quot;, &quot;builtin-config.c&quot;, &quot;gitenv.c&quot;, &quot;describe.c&quot;, &quot;git-add--interactive.perl&quot;, &quot;pull.h&quot;, &quot;builtin-apply.c&quot;, &quot;diff-index.c&quot;, &quot;ssh-pull.c&quot;, &quot;builtin-merge-file.c&quot;, &quot;strbuf.c&quot;, &quot;git-submodule.sh&quot;, &quot;repo-config.c&quot;, &quot;run-command.c&quot;, &quot;git-applymbox.sh&quot;, &quot;cache-tree.h&quot;, &quot;builtin-clean.c&quot;, &quot;cache.h&quot;, &quot;git-prune.sh&quot;, &quot;fsck-cache.c&quot;, &quot;builtin-remote.c&quot;, &quot;sha1_file.c&quot;, &quot;shallow.c&quot;, &quot;merge-recursive.h&quot;, &quot;builtin-checkout-index.c&quot;, &quot;git-clone.sh&quot;, &quot;builtin-mv.c&quot;, &quot;builtin-reflog.c&quot;, &quot;lockfile.c&quot;, &quot;git-octopus-script&quot;, &quot;.mailmap&quot;, &quot;strbuf.h&quot;, &quot;git-p4import.py&quot;, &quot;builtin-repo-config.c&quot;, &quot;patch-delta.c&quot;, &quot;builtin-merge-base.c&quot;, &quot;run-command.h&quot;, &quot;check-racy.c&quot;, &quot;git-filter-branch.sh&quot;, &quot;git-branch.sh&quot;, &quot;git-merge-stupid.sh&quot;, &quot;diff-files.c&quot;, &quot;test-sha1.sh&quot;, &quot;COPYING&quot;, &quot;git-lost+found.sh&quot;, &quot;git-tag.sh&quot;, &quot;git-branch-script&quot;, &quot;check-files.c&quot;, &quot;builtin-reset.c&quot;, &quot;builtin-ls-files.c&quot;, &quot;builtin-fmt-merge-msg.c&quot;, &quot;builtin-for-each-ref.c&quot;, &quot;csum-file.c&quot;, &quot;git-gc.sh&quot;, &quot;git-parse-remote-script&quot;, &quot;command-list.txt&quot;, &quot;builtin-pack-objects.c&quot;, &quot;dir.c&quot;, &quot;test-date.c&quot;, &quot;builtin-grep.c&quot;, &quot;list-objects.c&quot;, &quot;clone-pack.c&quot;, &quot;git-gui&quot;, &quot;convert-cache.c&quot;, &quot;git-reset-script&quot;, &quot;checkout-cache.c&quot;, &quot;git-ls-remote.sh&quot;, &quot;read-tree.c&quot;, &quot;git-instaweb.sh&quot;, &quot;progress.c&quot;, &quot;rabinpoly.c&quot;, &quot;ls-files.c&quot;, &quot;mktag.c&quot;, &quot;gitMergeCommon.py&quot;, &quot;git-merge-ours.sh&quot;, &quot;rpull.c&quot;, &quot;git-annotate.perl&quot;, &quot;csum-file.h&quot;, &quot;builtin-shortlog.c&quot;, &quot;builtin-commit.c&quot;, &quot;http-pull.c&quot;, &quot;git-fetch.sh&quot;, &quot;apply.c&quot;, &quot;git-add-script&quot;, &quot;dir.h&quot;, &quot;diff-tree-helper.c&quot;, &quot;list-objects.h&quot;, &quot;rev-tree.c&quot;, &quot;builtin-tar-tree.c&quot;, &quot;progress.h&quot;, &quot;builtin-pickaxe.c&quot;, &quot;git-merge-fredrik.py&quot;, &quot;path.c&quot;, &quot;builtin-diff-tree.c&quot;, &quot;rabinpoly.h&quot;, &quot;builtin-ls-tree.c&quot;, &quot;tar.h&quot;, &quot;trace.c&quot;, &quot;graph.c&quot;, &quot;ssh-fetch.c&quot;, &quot;show-diff.c&quot;, &quot;sha1-lookup.c&quot;, &quot;builtin-revert.c&quot;, &quot;builtin-symbolic-ref.c&quot;, &quot;builtin-write-tree.c&quot;, &quot;git-sh-setup-script&quot;, &quot;rev-cache.c&quot;, &quot;blame.c&quot;, &quot;builtin-mailinfo.c&quot;, &quot;git-cherry&quot;, &quot;git-resolve-script&quot;, &quot;INSTALL&quot;, &quot;git-findtags.perl&quot;, &quot;diffcore-delta.c&quot;, &quot;entry.c&quot;, &quot;git-applypatch&quot;, &quot;connect.c&quot;, &quot;tar-tree.c&quot;, &quot;graph.h&quot;, &quot;missing-revs.c&quot;, &quot;builtin-fast-export.c&quot;, &quot;sha1-lookup.h&quot;, &quot;rev-parse.c&quot;, &quot;configure.ac&quot;, &quot;rev-cache.h&quot;, &quot;build-rev-cache.c&quot;, &quot;reachable.c&quot;, &quot;index-pack.c&quot;, &quot;git&quot;, &quot;send-pack.c&quot;, &quot;git-cherry.sh&quot;, &quot;git-tag-script&quot;, &quot;revision.c&quot;, &quot;CREDITS-GEN&quot;, &quot;bundle.c&quot;, &quot;mailinfo.c&quot;, &quot;symbolic-ref.c&quot;, &quot;attr.c&quot;, &quot;git-archimport-script&quot;, &quot;archive-zip.c&quot;, &quot;diff-cache.c&quot;, &quot;fetch.c&quot;, &quot;builtin-gc.c&quot;, &quot;git-remote.perl&quot;, &quot;path-list.c&quot;, &quot;ssh-upload.c&quot;, &quot;reachable.h&quot;, &quot;diff-no-index.c&quot;, &quot;diffcore.h&quot;, &quot;send-pack.h&quot;, &quot;tree-diff.c&quot;, &quot;git-checkout-script&quot;, &quot;pack-revindex.c&quot;, &quot;show-rev-cache.c&quot;, &quot;TODO&quot;, &quot;revision.h&quot;, &quot;bundle.h&quot;, &quot;unresolve.c&quot;, &quot;git-deltafy-script&quot;, &quot;git-relink.perl&quot;, &quot;archive-tar.c&quot;, &quot;attr.h&quot;, &quot;git-resolve.sh&quot;, &quot;config.mak.in&quot;, &quot;builtin-update-index.c&quot;, &quot;convert-objects.c&quot;, &quot;fetch.h&quot;, &quot;builtin-runstatus.c&quot;, &quot;quote.c&quot;, &quot;init-db.c&quot;, &quot;git-shortlog&quot;, &quot;builtin-prune.c&quot;, &quot;builtin-rerere.c&quot;, &quot;verify-pack.c&quot;, &quot;gitk&quot;, &quot;patch-id.c&quot;, &quot;.gitattributes&quot;, &quot;date.c&quot;, &quot;git-format-patch-script&quot;, &quot;path-list.h&quot;, &quot;pack-revindex.h&quot;, &quot;GIT-VERSION-GEN&quot;, &quot;combine-diff.c&quot;, &quot;environment.c&quot;, &quot;git-cvsserver.perl&quot;, &quot;git-repack.sh&quot;, &quot;diffcore-order.c&quot;, &quot;reflog-walk.c&quot;, &quot;config.c&quot;, &quot;test-match-trees.c&quot;, &quot;git-svnimport.perl&quot;, &quot;quote.h&quot;, &quot;write-blob.c&quot;, &quot;diffcore-pickaxe.c&quot;, &quot;builtin-update-ref.c&quot;, &quot;stripspace.c&quot;, &quot;help.c&quot;, &quot;pack-objects.c&quot;, &quot;branch.c&quot;, &quot;git-verify-tag-script&quot;, &quot;TEST&quot;, &quot;daemon.c&quot;, &quot;remote.c&quot;, &quot;git-log-script&quot;, &quot;git-pull.sh&quot;, &quot;git-quiltimport.sh&quot;, &quot;git-count-objects.sh&quot;, &quot;reflog-walk.h&quot;, &quot;git-applymbox&quot;, &quot;builtin-show-ref.c&quot;, &quot;RelNotes&quot;, &quot;git-fmt-merge-msg.perl&quot;, &quot;git-rebase.sh&quot;, &quot;git-parse-remote&quot;, &quot;git-browse--help.sh&quot;, &quot;git-stash.sh&quot;, &quot;alias.c&quot;, &quot;branch.h&quot;, &quot;gitweb.pl&quot;, &quot;builtin-upload-archive.c&quot;, &quot;builtin-cat-file.c&quot;, &quot;sha1_name.c&quot;, &quot;http.c&quot;, &quot;test-chmtime.c&quot;, &quot;remote.h&quot;, &quot;ssh-push.c&quot;, &quot;tag.c&quot;, &quot;update-server-info.c&quot;, &quot;git-cvsexportcommit.perl&quot;, &quot;builtin-check-attr.c&quot;, &quot;git-revert.sh&quot;, &quot;builtin-verify-pack.c&quot;, &quot;object.c&quot;, &quot;git-merge-resolve.sh&quot;, &quot;shortlog.h&quot;, &quot;git-fetch-script&quot;, &quot;test-genrandom.c&quot;, &quot;shell.c&quot;, &quot;builtin-rm.c&quot;, &quot;builtin-zip-tree.c&quot;, &quot;upload-pack.c&quot;, &quot;git-rename.perl&quot;, &quot;.gitignore&quot;, &quot;tag.h&quot;, &quot;http.h&quot;, &quot;git-request-pull.sh&quot;, &quot;object.h&quot;, &quot;git-svn.perl&quot;, &quot;builtin-fetch-pack.c&quot;, &quot;git-bisect.sh&quot;, &quot;pack-check.c&quot;, &quot;builtin-rev-parse.c&quot;, &quot;object-refs.c&quot;, &quot;test-gsimm.c&quot;, &quot;builtin-read-tree.c&quot;, &quot;git-help--browse.sh&quot;, &quot;merge-file.c&quot;, &quot;fsck.c&quot;, &quot;builtin-tag.c&quot;, &quot;builtin-http-fetch.c&quot;, &quot;builtin-count-objects.c&quot;, &quot;git-reset.sh&quot;, &quot;git-clean.sh&quot;, &quot;git-merge-one-file.sh&quot;, &quot;ctype.c&quot;, &quot;git-mktag.c&quot;, &quot;imap-send.c&quot;]
+  #repo = '/Users/schacon/projects/git/.git'
+  #commit = 'd8933f013a66cc1deadf83a9c24eccb6fee78a35'
+  #file_list = [&quot;builtin-merge-recursive.c&quot;, &quot;git-send-email-script&quot;, &quot;git-parse-remote.sh&quot;, &quot;builtin-add.c&quot;, &quot;merge-base.c&quot;, &quot;read-cache.c&quot;, &quot;fsck.h&quot;, &quot;diff.c&quot;, &quot;refs.c&quot;, &quot;diffcore-rename.c&quot;, &quot;epoch.c&quot;, &quot;pack-intersect.c&quot;, &quot;fast-import.c&quot;, &quot;git-applypatch.sh&quot;, &quot;git.spec.in&quot;, &quot;rpush.c&quot;, &quot;git-clone-script&quot;, &quot;utf8.c&quot;, &quot;git-external-diff-script&quot;, &quot;builtin-init-db.c&quot;, &quot;pack-redundant.c&quot;, &quot;builtin-diff-index.c&quot;, &quot;index.c&quot;, &quot;update-index.c&quot;, &quot;fetch-clone.c&quot;, &quot;pager.c&quot;, &quot;diff.h&quot;, &quot;unpack-trees.c&quot;, &quot;git-browse-help.sh&quot;, &quot;git-rename-script&quot;, &quot;refs.h&quot;, &quot;get-tar-commit-id.c&quot;, &quot;git-push.sh&quot;, &quot;README&quot;, &quot;delta.c&quot;, &quot;mailsplit.c&quot;, &quot;gitweb.cgi&quot;, &quot;var.c&quot;, &quot;epoch.h&quot;, &quot;gsimm.c&quot;, &quot;archive.c&quot;, &quot;sideband.c&quot;, &quot;utf8.h&quot;, &quot;local-fetch.c&quot;, &quot;git-request-pull-script&quot;, &quot;builtin-send-pack.c&quot;, &quot;blob.c&quot;, &quot;builtin-ls-remote.c&quot;, &quot;pretty.c&quot;, &quot;git-diff.sh&quot;, &quot;diffcore-break.c&quot;, &quot;unpack-trees.h&quot;, &quot;git-mv.perl&quot;, &quot;interpolate.c&quot;, &quot;builtin-diff-files.c&quot;, &quot;delta.h&quot;, &quot;commit-tree.c&quot;, &quot;git-diff-script&quot;, &quot;decorate.c&quot;, &quot;builtin-name-rev.c&quot;, &quot;tree-walk.c&quot;, &quot;git-revert-script&quot;, &quot;git-sh-setup.sh&quot;, &quot;transport.c&quot;, &quot;gsimm.h&quot;, &quot;archive.h&quot;, &quot;count-delta.c&quot;, &quot;sideband.h&quot;, &quot;git-merge.sh&quot;, &quot;git-gui.sh&quot;, &quot;git-core.spec.in&quot;, &quot;cvs2git.c&quot;, &quot;blob.h&quot;, &quot;git.sh&quot;, &quot;http-push.c&quot;, &quot;builtin-commit-tree.c&quot;, &quot;diff-helper.c&quot;, &quot;builtin-push.c&quot;, &quot;interpolate.h&quot;, &quot;decorate.h&quot;, &quot;git-citool&quot;, &quot;dotest&quot;, &quot;builtin-verify-tag.c&quot;, &quot;git-mergetool.sh&quot;, &quot;tree-walk.h&quot;, &quot;log-tree.c&quot;, &quot;name-rev.c&quot;, &quot;applypatch&quot;, &quot;cat-file.c&quot;, &quot;test-delta.c&quot;, &quot;server-info.c&quot;, &quot;count-delta.h&quot;, &quot;write-tree.c&quot;, &quot;local-pull.c&quot;, &quot;transport.h&quot;, &quot;git-rm.sh&quot;, &quot;unpack-objects.c&quot;, &quot;xdiff-interface.c&quot;, &quot;git-repack-script&quot;, &quot;commit.c&quot;, &quot;hash-object.c&quot;, &quot;git-merge-recursive.py&quot;, &quot;git-clone-dumb-http&quot;, &quot;thread-utils.c&quot;, &quot;git-send-email.perl&quot;, &quot;git-whatchanged.sh&quot;, &quot;log-tree.h&quot;, &quot;builtin-annotate.c&quot;, &quot;show-index.c&quot;, &quot;pkt-line.c&quot;, &quot;ident.c&quot;, &quot;git-rebase-script&quot;, &quot;name-hash.c&quot;, &quot;git-archimport.perl&quot;, &quot;xdiff-interface.h&quot;, &quot;commit.h&quot;, &quot;diff-lib.c&quot;, &quot;wt-status.c&quot;, &quot;base85.c&quot;, &quot;builtin-fetch--tool.c&quot;, &quot;unpack-file.c&quot;, &quot;builtin-diff-stages.c&quot;, &quot;merge-index.c&quot;, &quot;color.c&quot;, &quot;diff-tree.c&quot;, &quot;git-checkout.sh&quot;, &quot;thread-utils.h&quot;, &quot;grep.c&quot;, &quot;pkt-line.h&quot;, &quot;builtin-help.c&quot;, &quot;test-parse-options.c&quot;, &quot;show-files.c&quot;, &quot;git.sh.in&quot;, &quot;pack.h&quot;, &quot;wt-status.h&quot;, &quot;git-prune-script&quot;, &quot;test-sha1.c&quot;, &quot;git-octopus.sh&quot;, &quot;dump-cache-tree.c&quot;, &quot;git-web--browse.sh&quot;, &quot;builtin-upload-tar.c&quot;, &quot;builtin-clone.c&quot;, &quot;copy.c&quot;, &quot;color.h&quot;, &quot;show-branch.c&quot;, &quot;peek-remote.c&quot;, &quot;git-merge-recursive-old.py&quot;, &quot;cmd-rename.sh&quot;, &quot;git-apply-patch-script&quot;, &quot;git-export.c&quot;, &quot;git-relink-script&quot;, &quot;grep.h&quot;, &quot;usage.c&quot;, &quot;git-fetch-dumb-http&quot;, &quot;fsck-objects.c&quot;, &quot;update-cache.c&quot;, &quot;diff-stages.c&quot;, &quot;patch-ids.c&quot;, &quot;builtin-rev-list.c&quot;, &quot;builtin-bundle.c&quot;, &quot;builtin-show-branch.c&quot;, &quot;builtin-pack-refs.c&quot;, &quot;tree.c&quot;, &quot;git.c&quot;, &quot;verify_pack.c&quot;, &quot;update-ref.c&quot;, &quot;builtin-peek-remote.c&quot;, &quot;diffcore-pathspec.c&quot;, &quot;git-merge-octopus.sh&quot;, &quot;git-show-branches-script&quot;, &quot;builtin-archive.c&quot;, &quot;builtin-unpack-objects.c&quot;, &quot;git-rerere.perl&quot;, &quot;walker.c&quot;, &quot;builtin-mailsplit.c&quot;, &quot;convert.c&quot;, &quot;builtin-branch.c&quot;, &quot;export.c&quot;, &quot;patch-ids.h&quot;, &quot;check-builtins.sh&quot;, &quot;git-pull-script&quot;, &quot;tree.h&quot;, &quot;alloc.c&quot;, &quot;git-commit.sh&quot;, &quot;git-lost-found.sh&quot;, &quot;mailmap.c&quot;, &quot;rsh.c&quot;, &quot;exec_cmd.c&quot;, &quot;git-compat-util.h&quot;, &quot;ws.c&quot;, &quot;rev-list.c&quot;, &quot;git-verify-tag.sh&quot;, &quot;git-ls-remote-script&quot;, &quot;mktree.c&quot;, &quot;walker.h&quot;, &quot;builtin-blame.c&quot;, &quot;builtin-fsck.c&quot;, &quot;setup.c&quot;, &quot;git-cvsimport-script&quot;, &quot;git-add.sh&quot;, &quot;symlinks.c&quot;, &quot;checkout-index.c&quot;, &quot;receive-pack.c&quot;, &quot;git-merge-one-file-script&quot;, &quot;mailmap.h&quot;, &quot;git-cvsimport.perl&quot;, &quot;builtin-count.c&quot;, &quot;exec_cmd.h&quot;, &quot;builtin-stripspace.c&quot;, &quot;git-grep.sh&quot;, &quot;hash.c&quot;, &quot;builtin-prune-packed.c&quot;, &quot;git-rebase--interactive.sh&quot;, &quot;rsh.h&quot;, &quot;match-trees.c&quot;, &quot;git-format-patch.sh&quot;, &quot;git-push-script&quot;, &quot;parse-options.c&quot;, &quot;git-status-script&quot;, &quot;http-walker.c&quot;, &quot;pack-write.c&quot;, &quot;git-status.sh&quot;, &quot;diff-delta.c&quot;, &quot;hash.h&quot;, &quot;generate-cmdlist.sh&quot;, &quot;config-set.c&quot;, &quot;builtin-fetch.c&quot;, &quot;ll-merge.c&quot;, &quot;t1300-config-set.sh&quot;, &quot;ls-tree.c&quot;, &quot;write_or_die.c&quot;, &quot;builtin-check-ref-format.c&quot;, &quot;fetch-pack.c&quot;, &quot;git-commit-script&quot;, &quot;builtin-describe.c&quot;, &quot;parse-options.h&quot;, &quot;builtin-checkout.c&quot;, &quot;prune-packed.c&quot;, &quot;fixup-builtins&quot;, &quot;http-fetch.c&quot;, &quot;test-absolute-path.c&quot;, &quot;git-log.sh&quot;, &quot;builtin-merge-ours.c&quot;, &quot;git-whatchanged&quot;, &quot;pull.c&quot;, &quot;merge-tree.c&quot;, &quot;ll-merge.h&quot;, &quot;builtin.h&quot;, &quot;Makefile&quot;, &quot;cache-tree.c&quot;, &quot;builtin-log.c&quot;, &quot;merge-cache.c&quot;, &quot;fetch-pack.h&quot;, &quot;git-shortlog.perl&quot;, &quot;git-bisect-script&quot;, &quot;git-am.sh&quot;, &quot;check-ref-format.c&quot;, &quot;git-count-objects-script&quot;, &quot;mkdelta.c&quot;, &quot;builtin-diff.c&quot;, &quot;merge-recursive.c&quot;, &quot;builtin-config.c&quot;, &quot;gitenv.c&quot;, &quot;describe.c&quot;, &quot;git-add--interactive.perl&quot;, &quot;pull.h&quot;, &quot;builtin-apply.c&quot;, &quot;diff-index.c&quot;, &quot;ssh-pull.c&quot;, &quot;builtin-merge-file.c&quot;, &quot;strbuf.c&quot;, &quot;git-submodule.sh&quot;, &quot;repo-config.c&quot;, &quot;run-command.c&quot;, &quot;git-applymbox.sh&quot;, &quot;cache-tree.h&quot;, &quot;builtin-clean.c&quot;, &quot;cache.h&quot;, &quot;git-prune.sh&quot;, &quot;fsck-cache.c&quot;, &quot;builtin-remote.c&quot;, &quot;sha1_file.c&quot;, &quot;shallow.c&quot;, &quot;merge-recursive.h&quot;, &quot;builtin-checkout-index.c&quot;, &quot;git-clone.sh&quot;, &quot;builtin-mv.c&quot;, &quot;builtin-reflog.c&quot;, &quot;lockfile.c&quot;, &quot;git-octopus-script&quot;, &quot;.mailmap&quot;, &quot;strbuf.h&quot;, &quot;git-p4import.py&quot;, &quot;builtin-repo-config.c&quot;, &quot;patch-delta.c&quot;, &quot;builtin-merge-base.c&quot;, &quot;run-command.h&quot;, &quot;check-racy.c&quot;, &quot;git-filter-branch.sh&quot;, &quot;git-branch.sh&quot;, &quot;git-merge-stupid.sh&quot;, &quot;diff-files.c&quot;, &quot;test-sha1.sh&quot;, &quot;COPYING&quot;, &quot;git-lost+found.sh&quot;, &quot;git-tag.sh&quot;, &quot;git-branch-script&quot;, &quot;check-files.c&quot;, &quot;builtin-reset.c&quot;, &quot;builtin-ls-files.c&quot;, &quot;builtin-fmt-merge-msg.c&quot;, &quot;builtin-for-each-ref.c&quot;, &quot;csum-file.c&quot;, &quot;git-gc.sh&quot;, &quot;git-parse-remote-script&quot;, &quot;command-list.txt&quot;, &quot;builtin-pack-objects.c&quot;, &quot;dir.c&quot;, &quot;test-date.c&quot;, &quot;builtin-grep.c&quot;, &quot;list-objects.c&quot;, &quot;clone-pack.c&quot;, &quot;git-gui&quot;, &quot;convert-cache.c&quot;, &quot;git-reset-script&quot;, &quot;checkout-cache.c&quot;, &quot;git-ls-remote.sh&quot;, &quot;read-tree.c&quot;, &quot;git-instaweb.sh&quot;, &quot;progress.c&quot;, &quot;rabinpoly.c&quot;, &quot;ls-files.c&quot;, &quot;mktag.c&quot;, &quot;gitMergeCommon.py&quot;, &quot;git-merge-ours.sh&quot;, &quot;rpull.c&quot;, &quot;git-annotate.perl&quot;, &quot;csum-file.h&quot;, &quot;builtin-shortlog.c&quot;, &quot;builtin-commit.c&quot;, &quot;http-pull.c&quot;, &quot;git-fetch.sh&quot;, &quot;apply.c&quot;, &quot;git-add-script&quot;, &quot;dir.h&quot;, &quot;diff-tree-helper.c&quot;, &quot;list-objects.h&quot;, &quot;rev-tree.c&quot;, &quot;builtin-tar-tree.c&quot;, &quot;progress.h&quot;, &quot;builtin-pickaxe.c&quot;, &quot;git-merge-fredrik.py&quot;, &quot;path.c&quot;, &quot;builtin-diff-tree.c&quot;, &quot;rabinpoly.h&quot;, &quot;builtin-ls-tree.c&quot;, &quot;tar.h&quot;, &quot;trace.c&quot;, &quot;graph.c&quot;, &quot;ssh-fetch.c&quot;, &quot;show-diff.c&quot;, &quot;sha1-lookup.c&quot;, &quot;builtin-revert.c&quot;, &quot;builtin-symbolic-ref.c&quot;, &quot;builtin-write-tree.c&quot;, &quot;git-sh-setup-script&quot;, &quot;rev-cache.c&quot;, &quot;blame.c&quot;, &quot;builtin-mailinfo.c&quot;, &quot;git-cherry&quot;, &quot;git-resolve-script&quot;, &quot;INSTALL&quot;, &quot;git-findtags.perl&quot;, &quot;diffcore-delta.c&quot;, &quot;entry.c&quot;, &quot;git-applypatch&quot;, &quot;connect.c&quot;, &quot;tar-tree.c&quot;, &quot;graph.h&quot;, &quot;missing-revs.c&quot;, &quot;builtin-fast-export.c&quot;, &quot;sha1-lookup.h&quot;, &quot;rev-parse.c&quot;, &quot;configure.ac&quot;, &quot;rev-cache.h&quot;, &quot;build-rev-cache.c&quot;, &quot;reachable.c&quot;, &quot;index-pack.c&quot;, &quot;git&quot;, &quot;send-pack.c&quot;, &quot;git-cherry.sh&quot;, &quot;git-tag-script&quot;, &quot;revision.c&quot;, &quot;CREDITS-GEN&quot;, &quot;bundle.c&quot;, &quot;mailinfo.c&quot;, &quot;symbolic-ref.c&quot;, &quot;attr.c&quot;, &quot;git-archimport-script&quot;, &quot;archive-zip.c&quot;, &quot;diff-cache.c&quot;, &quot;fetch.c&quot;, &quot;builtin-gc.c&quot;, &quot;git-remote.perl&quot;, &quot;path-list.c&quot;, &quot;ssh-upload.c&quot;, &quot;reachable.h&quot;, &quot;diff-no-index.c&quot;, &quot;diffcore.h&quot;, &quot;send-pack.h&quot;, &quot;tree-diff.c&quot;, &quot;git-checkout-script&quot;, &quot;pack-revindex.c&quot;, &quot;show-rev-cache.c&quot;, &quot;TODO&quot;, &quot;revision.h&quot;, &quot;bundle.h&quot;, &quot;unresolve.c&quot;, &quot;git-deltafy-script&quot;, &quot;git-relink.perl&quot;, &quot;archive-tar.c&quot;, &quot;attr.h&quot;, &quot;git-resolve.sh&quot;, &quot;config.mak.in&quot;, &quot;builtin-update-index.c&quot;, &quot;convert-objects.c&quot;, &quot;fetch.h&quot;, &quot;builtin-runstatus.c&quot;, &quot;quote.c&quot;, &quot;init-db.c&quot;, &quot;git-shortlog&quot;, &quot;builtin-prune.c&quot;, &quot;builtin-rerere.c&quot;, &quot;verify-pack.c&quot;, &quot;gitk&quot;, &quot;patch-id.c&quot;, &quot;.gitattributes&quot;, &quot;date.c&quot;, &quot;git-format-patch-script&quot;, &quot;path-list.h&quot;, &quot;pack-revindex.h&quot;, &quot;GIT-VERSION-GEN&quot;, &quot;combine-diff.c&quot;, &quot;environment.c&quot;, &quot;git-cvsserver.perl&quot;, &quot;git-repack.sh&quot;, &quot;diffcore-order.c&quot;, &quot;reflog-walk.c&quot;, &quot;config.c&quot;, &quot;test-match-trees.c&quot;, &quot;git-svnimport.perl&quot;, &quot;quote.h&quot;, &quot;write-blob.c&quot;, &quot;diffcore-pickaxe.c&quot;, &quot;builtin-update-ref.c&quot;, &quot;stripspace.c&quot;, &quot;help.c&quot;, &quot;pack-objects.c&quot;, &quot;branch.c&quot;, &quot;git-verify-tag-script&quot;, &quot;TEST&quot;, &quot;daemon.c&quot;, &quot;remote.c&quot;, &quot;git-log-script&quot;, &quot;git-pull.sh&quot;, &quot;git-quiltimport.sh&quot;, &quot;git-count-objects.sh&quot;, &quot;reflog-walk.h&quot;, &quot;git-applymbox&quot;, &quot;builtin-show-ref.c&quot;, &quot;RelNotes&quot;, &quot;git-fmt-merge-msg.perl&quot;, &quot;git-rebase.sh&quot;, &quot;git-parse-remote&quot;, &quot;git-browse--help.sh&quot;, &quot;git-stash.sh&quot;, &quot;alias.c&quot;, &quot;branch.h&quot;, &quot;gitweb.pl&quot;, &quot;builtin-upload-archive.c&quot;, &quot;builtin-cat-file.c&quot;, &quot;sha1_name.c&quot;, &quot;http.c&quot;, &quot;test-chmtime.c&quot;, &quot;remote.h&quot;, &quot;ssh-push.c&quot;, &quot;tag.c&quot;, &quot;update-server-info.c&quot;, &quot;git-cvsexportcommit.perl&quot;, &quot;builtin-check-attr.c&quot;, &quot;git-revert.sh&quot;, &quot;builtin-verify-pack.c&quot;, &quot;object.c&quot;, &quot;git-merge-resolve.sh&quot;, &quot;shortlog.h&quot;, &quot;git-fetch-script&quot;, &quot;test-genrandom.c&quot;, &quot;shell.c&quot;, &quot;builtin-rm.c&quot;, &quot;builtin-zip-tree.c&quot;, &quot;upload-pack.c&quot;, &quot;git-rename.perl&quot;, &quot;.gitignore&quot;, &quot;tag.h&quot;, &quot;http.h&quot;, &quot;git-request-pull.sh&quot;, &quot;object.h&quot;, &quot;git-svn.perl&quot;, &quot;builtin-fetch-pack.c&quot;, &quot;git-bisect.sh&quot;, &quot;pack-check.c&quot;, &quot;builtin-rev-parse.c&quot;, &quot;object-refs.c&quot;, &quot;test-gsimm.c&quot;, &quot;builtin-read-tree.c&quot;, &quot;git-help--browse.sh&quot;, &quot;merge-file.c&quot;, &quot;fsck.c&quot;, &quot;builtin-tag.c&quot;, &quot;builtin-http-fetch.c&quot;, &quot;builtin-count-objects.c&quot;, &quot;git-reset.sh&quot;, &quot;git-clean.sh&quot;, &quot;git-merge-one-file.sh&quot;, &quot;ctype.c&quot;, &quot;git-mktag.c&quot;, &quot;imap-send.c&quot;]
+
+  repo = '/Users/schacon/projects/grit/.git'
+  commit = 'c87612bc84c95ba9df17674d911dde10f34fefaa'
 
   require 'benchmark'
   
@@ -156,7 +166,8 @@ if __FILE__ == $0
     end
     x.report('last commits') do
       i = Grit::GitRuby::FileIndex.new(repo)
-      arr = i.last_commits(commit, file_list)
+      #arr = i.last_commits(commit, file_list)
+      arr = i.last_commits(commit, /^[^\/]*$/)
     end
   end
 end</diff>
      <filename>lib/grit/git-ruby/file_index.rb</filename>
    </modified>
    <modified>
      <diff>@@ -55,6 +55,12 @@ module Grit
       call = &quot;#{Git.git_binary} --git-dir='#{self.git_dir}' #{cmd.to_s.gsub(/_/, '-')} #{(opt_args + ext_args).join(' ')}&quot;
       puts call if Grit.debug
       
+      puts
+      puts '**'
+      puts call
+      puts '**'
+      puts
+      
       response = timeout ? sh(call) : wild_sh(call)
       puts response if Grit.debug
       response</diff>
      <filename>lib/grit/git.rb</filename>
    </modified>
    <modified>
      <diff>@@ -94,7 +94,13 @@ module Grit
     
 
     def blame_tree(commit, path = nil)
-      self.git.blame_tree(commit, path)
+      commit_array = self.git.blame_tree(commit, path)
+      
+      final_array = {}
+      commit_array.each do |file, sha|
+        final_array[file] = commit(sha)
+      end
+      final_array
     end
     
     def status</diff>
      <filename>lib/grit/repo.rb</filename>
    </modified>
    <modified>
      <diff>@@ -17,14 +17,16 @@ class TestBlameTree &lt; Test::Unit::TestCase
   def test_blame_tree_path   
     commit = '2d3acf90f35989df8f262dc50beadc4ee3ae1560'
     tree = @git.blame_tree(commit, 'lib')
-    last_commit_sha = tree['grit.rb']
+    last_commit_sha = tree['lib/grit.rb']
     assert_equal last_commit_sha, '5a0943123f6872e75a9b1dd0b6519dd42a186fda'
+    last_commit_sha = tree['lib/grit']
+    assert_equal last_commit_sha, '2d3acf90f35989df8f262dc50beadc4ee3ae1560'
   end
 
   def test_blame_tree_multi_path
     commit = '2d3acf90f35989df8f262dc50beadc4ee3ae1560'
     tree = @git.blame_tree(commit, 'lib/grit')
-    last_commit_sha = tree['diff.rb']
+    last_commit_sha = tree['lib/grit/diff.rb']
     assert_equal last_commit_sha, '22825175e37f22c9418d756ca69b574d75602994'
   end
   </diff>
      <filename>test/test_blame_tree.rb</filename>
    </modified>
    <modified>
      <diff>@@ -37,9 +37,14 @@ class TestFileIndex &lt; Test::Unit::TestCase
   
   def test_last_commits_pattern
     arr = @index.last_commits(@commit, /lib\/grit\/[^\/]*$/)
-    assert_equal 9, arr.size
+    assert_equal 10, arr.size
     assert_equal @commit, arr['lib/grit/commit.rb']
     assert_equal nil, arr['lib/grit/actor.rb']
   end
   
+  def test_last_commits_array
+    arr = @index.last_commits(@commit, ['lib/grit.rb', 'lib/grit/'])
+    assert_equal @commit, arr['lib/grit/']
+  end
+  
 end
\ No newline at end of file</diff>
      <filename>test/test_file_index.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>2cb492fffeaed93cf791d36dc60639c488b989c0</id>
    </parent>
  </parents>
  <author>
    <name>Scott Chacon</name>
    <email>schacon@gmail.com</email>
  </author>
  <url>http://github.com/schacon/grit/commit/a92a84f8cafa92ad576b2c9622bf48163b6afea4</url>
  <id>a92a84f8cafa92ad576b2c9622bf48163b6afea4</id>
  <committed-date>2008-06-28T14:40:07-07:00</committed-date>
  <authored-date>2008-06-28T14:40:07-07:00</authored-date>
  <message>patched bare rev-list to use FileIndex (for paging commit count)
FileIndex now understands tree changes
makes GitHub use almost no git calls, and can up max list over 30</message>
  <tree>b954fde8d54875f7087ad891c3fba4a5afe10e85</tree>
  <committer>
    <name>Scott Chacon</name>
    <email>schacon@gmail.com</email>
  </committer>
</commit>
