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
Show 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
end
def
create
return
unless
enabled?
&&
!
exist?
return
unless
enabled?
create_ref
(
sha
,
path
)
rescue
=>
e
...
...
spec/models/ci/persistent_ref_spec.rb
View file @
1712b688
...
...
@@ -73,8 +73,8 @@ describe Ci::PersistentRef do
pipeline
.
persistent_ref
.
create
end
it
'
does not create
a persistent ref'
do
expect
(
project
.
repository
).
not_to
receive
(
:create_ref
)
it
'
overwrites
a persistent ref'
do
expect
(
project
.
repository
).
to
receive
(
:create_ref
).
and_call_original
subject
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