Skip to content
This repository has been archived by the owner on May 12, 2018. It is now read-only.

Commit

Permalink
Fix branch_names_contains
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
  • Loading branch information
dzaporozhets committed Sep 29, 2014
1 parent 1c6cf0f commit d305de1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/gitlab_git/repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ def find_commits(options = {})
# repo.branch_names_contains('master')
#
def branch_names_contains(commit)
branches_contains(commit).map { |c| c.target_id }
branches_contains(commit).map { |c| c.name }
end

# Returns branch collection that contains the special commit(SHA1 or name)
Expand Down
9 changes: 8 additions & 1 deletion spec/repository_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
it { should respond_to(:tags) }
end


describe "#discover_default_branch" do
let(:master) { 'master' }
let(:feature) { 'feature' }
Expand Down Expand Up @@ -532,4 +531,12 @@
repo.references.update("refs/heads/master", SeedRepo::LastCommit::ID)
end
end

describe "branch_names_contains" do
subject { repository.branch_names_contains(SeedRepo::LastCommit::ID) }

it { should include('master') }
it { should_not include('feature') }
it { should_not include('fix') }
end
end

0 comments on commit d305de1

Please sign in to comment.