Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
43c3a650
Commit
43c3a650
authored
Jun 27, 2017
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove 'contains' option from Commit.find_all
parent
144e37c6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
26 deletions
+1
-26
lib/gitlab/git/commit.rb
lib/gitlab/git/commit.rb
+1
-6
spec/lib/gitlab/git/commit_spec.rb
spec/lib/gitlab/git/commit_spec.rb
+0
-20
No files found.
lib/gitlab/git/commit.rb
View file @
43c3a650
...
@@ -117,7 +117,6 @@ module Gitlab
...
@@ -117,7 +117,6 @@ module Gitlab
#
#
# +options+ is a Hash of optional arguments to git
# +options+ is a Hash of optional arguments to git
# :ref is the ref from which to begin (SHA1 or name)
# :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
# :max_count is the maximum number of commits to fetch
# :skip is the number of commits to skip
# :skip is the number of commits to skip
# :order is the commits order and allowed value is :none (default), :date,
# :order is the commits order and allowed value is :none (default), :date,
...
@@ -128,7 +127,7 @@ module Gitlab
...
@@ -128,7 +127,7 @@ module Gitlab
def
find_all
(
repo
,
options
=
{})
def
find_all
(
repo
,
options
=
{})
actual_options
=
options
.
dup
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
|
actual_options
.
keep_if
do
|
key
|
allowed_options
.
include?
(
key
)
allowed_options
.
include?
(
key
)
...
@@ -142,10 +141,6 @@ module Gitlab
...
@@ -142,10 +141,6 @@ module Gitlab
if
actual_options
[
:ref
]
if
actual_options
[
:ref
]
walker
.
push
(
rugged
.
rev_parse_oid
(
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
else
rugged
.
references
.
each
(
"refs/heads/*"
)
do
|
ref
|
rugged
.
references
.
each
(
"refs/heads/*"
)
do
|
ref
|
walker
.
push
(
ref
.
target_id
)
walker
.
push
(
ref
.
target_id
)
...
...
spec/lib/gitlab/git/commit_spec.rb
View file @
43c3a650
...
@@ -308,26 +308,6 @@ describe Gitlab::Git::Commit, seed_helper: true do
...
@@ -308,26 +308,6 @@ describe Gitlab::Git::Commit, seed_helper: true do
it
{
is_expected
.
to
include
(
SeedRepo
::
FirstCommit
::
ID
)
}
it
{
is_expected
.
to
include
(
SeedRepo
::
FirstCommit
::
ID
)
}
it
{
is_expected
.
not_to
include
(
SeedRepo
::
LastCommit
::
ID
)
}
it
{
is_expected
.
not_to
include
(
SeedRepo
::
LastCommit
::
ID
)
}
end
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
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment