Skip to content
Browse files

Check branch existence

Now 'git-bugspots /git/ruby' raises an ArgumentError because the default
branch name is 'master' (CRuby's 'master' is 'trunk')
  • Loading branch information...
1 parent a9debf9 commit b31d206796b760c839345062291530632a89a13f @nahi committed
Showing with 3 additions and 0 deletions.
  1. +3 −0 lib/bugspots/scanner.rb
View
3 lib/bugspots/scanner.rb
@@ -7,6 +7,9 @@ module Bugspots
def self.scan(repo, branch = "master", depth = 500, words = nil)
repo = Grit::Repo.new(repo)
+ unless repo.branches.find { |e| e.name == branch }
+ raise ArgumentError, "no such branch in the repo: #{branch}"
+ end
fixes = []
if words

0 comments on commit b31d206

Please sign in to comment.
Something went wrong with that request. Please try again.