Permalink
Browse files

Update Tree Search

Create repo tree before grabbing commits, to avoid accessing repo
repeatedly.
  • Loading branch information...
1 parent d259b6f commit 640fd31e65b1e47673f811aa733c2aa259e3c7da @msgerbush msgerbush committed Jan 5, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/bugspots/scanner.rb
View
3 lib/bugspots/scanner.rb
@@ -15,9 +15,10 @@ def self.scan(repo, branch = "master", depth = 500, words = nil)
message_matchers = /fix(es|ed)?|close(s|d)?/i
end
+ tree = repo.tree(branch)
repo.commits(branch, depth).each do |commit|
if commit.message =~ message_matchers
- files = commit.stats.files.map {|s| s.first}.select{ |s| repo.tree(branch)/s }
+ files = commit.stats.files.map {|s| s.first}.select{ |s| tree/s }
fixes << Fix.new(commit.short_message, commit.date, files)
end
end

0 comments on commit 640fd31

Please sign in to comment.