summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Vosmaer <jacob@gitlab.com>2017-06-27 12:30:15 +0200
committerJacob Vosmaer <jacob@gitlab.com>2017-06-27 12:38:58 +0200
commit43c3a65062ed321427634d88f81755daf5611900 (patch)
treec6c7e213a6544a8abd4e01208d9084267a24c229
parent144e37c667c1681ce8c1c8292ee8f48b9eb455c5 (diff)
downloadgitlab-ce-43c3a65062ed321427634d88f81755daf5611900.tar.gz
Remove 'contains' option from Commit.find_all
-rw-r--r--lib/gitlab/git/commit.rb7
-rw-r--r--spec/lib/gitlab/git/commit_spec.rb20
2 files changed, 1 insertions, 26 deletions
diff --git a/lib/gitlab/git/commit.rb b/lib/gitlab/git/commit.rb
index abd5fac8f78..9c0606d780a 100644
--- a/lib/gitlab/git/commit.rb
+++ b/lib/gitlab/git/commit.rb
@@ -117,7 +117,6 @@ module Gitlab
#
# +options+ is a Hash of optional arguments to git
# :ref is the ref from which to begin (SHA1 or name)
- # :contains is the commit contained by the refs from which to begin (SHA1 or name)
# :max_count is the maximum number of commits to fetch
# :skip is the number of commits to skip
# :order is the commits order and allowed value is :none (default), :date,
@@ -128,7 +127,7 @@ module Gitlab
def find_all(repo, options = {})
actual_options = options.dup
- allowed_options = [:ref, :max_count, :skip, :contains, :order]
+ allowed_options = [:ref, :max_count, :skip, :order]
actual_options.keep_if do |key|
allowed_options.include?(key)
@@ -142,10 +141,6 @@ module Gitlab
if actual_options[:ref]
walker.push(rugged.rev_parse_oid(actual_options[:ref]))
- elsif actual_options[:contains]
- repo.branches_contains(actual_options[:contains]).each do |branch|
- walker.push(branch.target_id)
- end
else
rugged.references.each("refs/heads/*") do |ref|
walker.push(ref.target_id)
diff --git a/spec/lib/gitlab/git/commit_spec.rb b/spec/lib/gitlab/git/commit_spec.rb
index 9e44aefc2db..f20a14155dc 100644
--- a/spec/lib/gitlab/git/commit_spec.rb
+++ b/spec/lib/gitlab/git/commit_spec.rb
@@ -308,26 +308,6 @@ describe Gitlab::Git::Commit, seed_helper: true do
it { is_expected.to include(SeedRepo::FirstCommit::ID) }
it { is_expected.not_to include(SeedRepo::LastCommit::ID) }
end
-
- context 'contains feature + max_count' do
- subject do
- commits = Gitlab::Git::Commit.find_all(
- repository,
- contains: 'feature',
- max_count: 7
- )
-
- commits.map { |c| c.id }
- end
-
- it 'has 7 elements' do
- expect(subject.size).to eq(7)
- end
-
- it { is_expected.not_to include(SeedRepo::Commit::PARENT_ID) }
- it { is_expected.not_to include(SeedRepo::Commit::ID) }
- it { is_expected.to include(SeedRepo::BigCommit::ID) }
- end
end
end