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
1712b688
Commit
1712b688
authored
Nov 20, 2019
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unnecessary existence check on persistent ref
This commit reduces the number of gitaly calls
parent
1c5076ae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
app/models/ci/persistent_ref.rb
app/models/ci/persistent_ref.rb
+1
-1
spec/models/ci/persistent_ref_spec.rb
spec/models/ci/persistent_ref_spec.rb
+2
-2
No files found.
app/models/ci/persistent_ref.rb
View file @
1712b688
...
@@ -22,7 +22,7 @@ module Ci
...
@@ -22,7 +22,7 @@ module Ci
end
end
def
create
def
create
return
unless
enabled?
&&
!
exist?
return
unless
enabled?
create_ref
(
sha
,
path
)
create_ref
(
sha
,
path
)
rescue
=>
e
rescue
=>
e
...
...
spec/models/ci/persistent_ref_spec.rb
View file @
1712b688
...
@@ -73,8 +73,8 @@ describe Ci::PersistentRef do
...
@@ -73,8 +73,8 @@ describe Ci::PersistentRef do
pipeline
.
persistent_ref
.
create
pipeline
.
persistent_ref
.
create
end
end
it
'
does not create
a persistent ref'
do
it
'
overwrites
a persistent ref'
do
expect
(
project
.
repository
).
not_to
receive
(
:create_ref
)
expect
(
project
.
repository
).
to
receive
(
:create_ref
).
and_call_original
subject
subject
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