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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
1f93e85a
Commit
1f93e85a
authored
Sep 03, 2018
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Gitlab::Git::Repository#fetch_root_ref
parent
ef6076e5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
0 deletions
+35
-0
lib/gitlab/git/repository.rb
lib/gitlab/git/repository.rb
+8
-0
spec/lib/gitlab/git/repository_spec.rb
spec/lib/gitlab/git/repository_spec.rb
+27
-0
No files found.
lib/gitlab/git/repository.rb
View file @
1f93e85a
...
...
@@ -666,6 +666,14 @@ module Gitlab
end
end
def
find_remote_root_ref
(
remote_name
)
return
unless
remote_name
.
present?
wrapped_gitaly_errors
do
gitaly_remote_client
.
find_remote_root_ref
(
remote_name
)
end
end
AUTOCRLF_VALUES
=
{
"true"
=>
true
,
"false"
=>
false
,
...
...
spec/lib/gitlab/git/repository_spec.rb
View file @
1f93e85a
...
...
@@ -583,6 +583,33 @@ describe Gitlab::Git::Repository, :seed_helper do
end
end
describe
'#find_remote_root_ref'
do
it
'gets the remote root ref from GitalyClient'
do
expect_any_instance_of
(
Gitlab
::
GitalyClient
::
RemoteService
)
.
to
receive
(
:find_remote_root_ref
).
and_call_original
expect
(
repository
.
find_remote_root_ref
(
'origin'
)).
to
eq
'master'
end
it
'returns nil when remote name is nil'
do
expect_any_instance_of
(
Gitlab
::
GitalyClient
::
RemoteService
)
.
not_to
receive
(
:find_remote_root_ref
)
expect
(
repository
.
find_remote_root_ref
(
nil
)).
to
be_nil
end
it
'returns nil when remote name is empty'
do
expect_any_instance_of
(
Gitlab
::
GitalyClient
::
RemoteService
)
.
not_to
receive
(
:find_remote_root_ref
)
expect
(
repository
.
find_remote_root_ref
(
''
)).
to
be_nil
end
it_behaves_like
'wrapping gRPC errors'
,
Gitlab
::
GitalyClient
::
RemoteService
,
:find_remote_root_ref
do
subject
{
repository
.
find_remote_root_ref
(
'origin'
)
}
end
end
describe
"#log"
do
shared_examples
'repository log'
do
let
(
:commit_with_old_name
)
do
...
...
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