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
21096e23
Commit
21096e23
authored
Sep 04, 2018
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Gitlab::GitalyClient::RemoteService#find_remote_root_ref
parent
c1c4d7ed
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
lib/gitlab/gitaly_client/remote_service.rb
lib/gitlab/gitaly_client/remote_service.rb
+12
-0
spec/lib/gitlab/gitaly_client/remote_service_spec.rb
spec/lib/gitlab/gitaly_client/remote_service_spec.rb
+11
-0
No files found.
lib/gitlab/gitaly_client/remote_service.rb
View file @
21096e23
...
@@ -52,6 +52,18 @@ module Gitlab
...
@@ -52,6 +52,18 @@ module Gitlab
response
.
result
response
.
result
end
end
def
find_remote_root_ref
(
remote_name
)
request
=
Gitaly
::
FindRemoteRootRefRequest
.
new
(
repository:
@gitaly_repo
,
remote:
remote_name
)
response
=
GitalyClient
.
call
(
@storage
,
:remote_service
,
:find_remote_root_ref
,
request
)
response
.
ref
.
presence
end
def
update_remote_mirror
(
ref_name
,
only_branches_matching
)
def
update_remote_mirror
(
ref_name
,
only_branches_matching
)
req_enum
=
Enumerator
.
new
do
|
y
|
req_enum
=
Enumerator
.
new
do
|
y
|
y
.
yield
Gitaly
::
UpdateRemoteMirrorRequest
.
new
(
y
.
yield
Gitaly
::
UpdateRemoteMirrorRequest
.
new
(
...
...
spec/lib/gitlab/gitaly_client/remote_service_spec.rb
View file @
21096e23
...
@@ -45,6 +45,17 @@ describe Gitlab::GitalyClient::RemoteService do
...
@@ -45,6 +45,17 @@ describe Gitlab::GitalyClient::RemoteService do
end
end
end
end
describe
'#find_remote_root_ref'
do
it
'sends an find_remote_root_ref message and returns the root ref'
do
expect_any_instance_of
(
Gitaly
::
RemoteService
::
Stub
)
.
to
receive
(
:find_remote_root_ref
)
.
with
(
gitaly_request_with_path
(
storage_name
,
relative_path
),
kind_of
(
Hash
))
.
and_return
(
double
(
ref:
'master'
))
expect
(
client
.
find_remote_root_ref
(
'origin'
)).
to
eq
'master'
end
end
describe
'#update_remote_mirror'
do
describe
'#update_remote_mirror'
do
let
(
:ref_name
)
{
'remote_mirror_1'
}
let
(
:ref_name
)
{
'remote_mirror_1'
}
let
(
:only_branches_matching
)
{
[
'my-branch'
,
'master'
]
}
let
(
:only_branches_matching
)
{
[
'my-branch'
,
'master'
]
}
...
...
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