Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Check branch existence #16

Merged
merged 1 commit into from

2 participants

@nahi

Now 'git-bugspots /git/ruby' raises an ArgumentError because the default
branch name is 'master' (CRuby's 'master' is 'trunk')

@nahi nahi Check branch existence
Now 'git-bugspots /git/ruby' raises an ArgumentError because the default
branch name is 'master' (CRuby's 'master' is 'trunk')
b31d206
@igrigorik igrigorik merged commit 30c2eb1 into igrigorik:master
@igrigorik
Owner

Awesome, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 11, 2012
  1. @nahi

    Check branch existence

    nahi authored
    Now 'git-bugspots /git/ruby' raises an ArgumentError because the default
    branch name is 'master' (CRuby's 'master' is 'trunk')
This page is out of date. Refresh to see the latest.
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
Something went wrong with that request. Please try again.