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
Léo-Paul Géneau
gitlab-ce
Commits
29a07fd3
Commit
29a07fd3
authored
Aug 03, 2017
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename 'commits_between' to 'rugged_commits_between'
parent
23c502b4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
7 deletions
+9
-7
lib/gitlab/git/commit.rb
lib/gitlab/git/commit.rb
+1
-1
lib/gitlab/git/repository.rb
lib/gitlab/git/repository.rb
+3
-1
spec/lib/gitlab/git/repository_spec.rb
spec/lib/gitlab/git/repository_spec.rb
+5
-5
No files found.
lib/gitlab/git/commit.rb
View file @
29a07fd3
...
@@ -102,7 +102,7 @@ module Gitlab
...
@@ -102,7 +102,7 @@ module Gitlab
if
is_enabled
if
is_enabled
repo
.
gitaly_commit_client
.
between
(
base
,
head
)
repo
.
gitaly_commit_client
.
between
(
base
,
head
)
else
else
repo
.
commits_between
(
base
,
head
).
map
{
|
c
|
decorate
(
c
)
}
repo
.
rugged_
commits_between
(
base
,
head
).
map
{
|
c
|
decorate
(
c
)
}
end
end
end
end
rescue
Rugged
::
ReferenceError
rescue
Rugged
::
ReferenceError
...
...
lib/gitlab/git/repository.rb
View file @
29a07fd3
...
@@ -327,7 +327,9 @@ module Gitlab
...
@@ -327,7 +327,9 @@ module Gitlab
# Return a collection of Rugged::Commits between the two revspec arguments.
# Return a collection of Rugged::Commits between the two revspec arguments.
# See http://git-scm.com/docs/git-rev-parse.html#_specifying_revisions for
# See http://git-scm.com/docs/git-rev-parse.html#_specifying_revisions for
# a detailed list of valid arguments.
# a detailed list of valid arguments.
def
commits_between
(
from
,
to
)
#
# Gitaly note: JV: to be deprecated in favor of Commit.between
def
rugged_commits_between
(
from
,
to
)
walker
=
Rugged
::
Walker
.
new
(
rugged
)
walker
=
Rugged
::
Walker
.
new
(
rugged
)
walker
.
sorting
(
Rugged
::
SORT_NONE
|
Rugged
::
SORT_REVERSE
)
walker
.
sorting
(
Rugged
::
SORT_NONE
|
Rugged
::
SORT_REVERSE
)
...
...
spec/lib/gitlab/git/repository_spec.rb
View file @
29a07fd3
...
@@ -757,13 +757,13 @@ describe Gitlab::Git::Repository, seed_helper: true do
...
@@ -757,13 +757,13 @@ describe Gitlab::Git::Repository, seed_helper: true do
end
end
end
end
describe
"#commits_between"
do
describe
"#
rugged_
commits_between"
do
context
'two SHAs'
do
context
'two SHAs'
do
let
(
:first_sha
)
{
'b0e52af38d7ea43cf41d8a6f2471351ac036d6c9'
}
let
(
:first_sha
)
{
'b0e52af38d7ea43cf41d8a6f2471351ac036d6c9'
}
let
(
:second_sha
)
{
'0e50ec4d3c7ce42ab74dda1d422cb2cbffe1e326'
}
let
(
:second_sha
)
{
'0e50ec4d3c7ce42ab74dda1d422cb2cbffe1e326'
}
it
'returns the number of commits between'
do
it
'returns the number of commits between'
do
expect
(
repository
.
commits_between
(
first_sha
,
second_sha
).
count
).
to
eq
(
3
)
expect
(
repository
.
rugged_
commits_between
(
first_sha
,
second_sha
).
count
).
to
eq
(
3
)
end
end
end
end
...
@@ -772,11 +772,11 @@ describe Gitlab::Git::Repository, seed_helper: true do
...
@@ -772,11 +772,11 @@ describe Gitlab::Git::Repository, seed_helper: true do
let
(
:branch
)
{
'master'
}
let
(
:branch
)
{
'master'
}
it
'returns the number of commits between a sha and a branch'
do
it
'returns the number of commits between a sha and a branch'
do
expect
(
repository
.
commits_between
(
sha
,
branch
).
count
).
to
eq
(
5
)
expect
(
repository
.
rugged_
commits_between
(
sha
,
branch
).
count
).
to
eq
(
5
)
end
end
it
'returns the number of commits between a branch and a sha'
do
it
'returns the number of commits between a branch and a sha'
do
expect
(
repository
.
commits_between
(
branch
,
sha
).
count
).
to
eq
(
0
)
# sha is before branch
expect
(
repository
.
rugged_
commits_between
(
branch
,
sha
).
count
).
to
eq
(
0
)
# sha is before branch
end
end
end
end
...
@@ -785,7 +785,7 @@ describe Gitlab::Git::Repository, seed_helper: true do
...
@@ -785,7 +785,7 @@ describe Gitlab::Git::Repository, seed_helper: true do
let
(
:second_branch
)
{
'master'
}
let
(
:second_branch
)
{
'master'
}
it
'returns the number of commits between'
do
it
'returns the number of commits between'
do
expect
(
repository
.
commits_between
(
first_branch
,
second_branch
).
count
).
to
eq
(
17
)
expect
(
repository
.
rugged_
commits_between
(
first_branch
,
second_branch
).
count
).
to
eq
(
17
)
end
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