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
89ab32c6
Commit
89ab32c6
authored
Jun 14, 2018
by
Zeger-Jan van de Weg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Branches are fully migrated to Gitaly
Closes:
https://gitlab.com/gitlab-org/gitaly/issues/389
parent
143a632e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
24 deletions
+2
-24
lib/gitlab/git/repository.rb
lib/gitlab/git/repository.rb
+2
-6
spec/lib/gitlab/git/repository_spec.rb
spec/lib/gitlab/git/repository_spec.rb
+0
-18
No files found.
lib/gitlab/git/repository.rb
View file @
89ab32c6
...
@@ -157,12 +157,8 @@ module Gitlab
...
@@ -157,12 +157,8 @@ module Gitlab
# Returns an Array of Branches
# Returns an Array of Branches
def
branches
def
branches
gitaly_migrate
(
:branches
,
status:
Gitlab
::
GitalyClient
::
MigrationStatus
::
OPT_OUT
)
do
|
is_enabled
|
wrapped_gitaly_errors
do
if
is_enabled
gitaly_ref_client
.
branches
gitaly_ref_client
.
branches
else
branches_filter
end
end
end
end
end
...
...
spec/lib/gitlab/git/repository_spec.rb
View file @
89ab32c6
...
@@ -1344,24 +1344,6 @@ describe Gitlab::Git::Repository, seed_helper: true do
...
@@ -1344,24 +1344,6 @@ describe Gitlab::Git::Repository, seed_helper: true do
end
end
end
end
# With Gitaly enabled, Gitaly just doesn't return deleted branches.
context
'with deleted branch with Gitaly disabled'
do
before
do
allow
(
Gitlab
::
GitalyClient
).
to
receive
(
:feature_enabled?
).
and_return
(
false
)
end
it
'returns no results'
do
ref
=
double
()
allow
(
ref
).
to
receive
(
:name
)
{
'bad-branch'
}
allow
(
ref
).
to
receive
(
:target
)
{
raise
Rugged
::
ReferenceError
}
branches
=
double
()
allow
(
branches
).
to
receive
(
:each
)
{
[
ref
].
each
}
allow
(
repository_rugged
).
to
receive
(
:branches
)
{
branches
}
expect
(
subject
).
to
be_empty
end
end
it_behaves_like
'wrapping gRPC errors'
,
Gitlab
::
GitalyClient
::
RefService
,
:branches
it_behaves_like
'wrapping gRPC errors'
,
Gitlab
::
GitalyClient
::
RefService
,
:branches
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