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
e8edb60d
Commit
e8edb60d
authored
Feb 04, 2021
by
Mike Kozono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor: Rename file_exist? to file_exists?
parent
94d5c97a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
ee/app/models/concerns/geo/blob_replicator_strategy.rb
ee/app/models/concerns/geo/blob_replicator_strategy.rb
+2
-2
ee/lib/gitlab/geo/replication/blob_retriever.rb
ee/lib/gitlab/geo/replication/blob_retriever.rb
+1
-1
ee/spec/support/shared_examples/models/concerns/blob_replicator_strategy_shared_examples.rb
...dels/concerns/blob_replicator_strategy_shared_examples.rb
+1
-1
No files found.
ee/app/models/concerns/geo/blob_replicator_strategy.rb
View file @
e8edb60d
...
...
@@ -72,7 +72,7 @@ module Geo
# we don't absolutely have to.
#
# @return [Boolean] whether the file exists on disk or in remote storage
def
file_exist?
def
file_exist
s
?
carrierwave_uploader
.
file
.
exists?
end
...
...
@@ -90,7 +90,7 @@ module Geo
#
# @return [Boolean] whether it can generate a checksum
def
checksummable?
carrierwave_uploader
.
file_storage?
&&
file_exist?
carrierwave_uploader
.
file_storage?
&&
file_exist
s
?
end
end
end
ee/lib/gitlab/geo/replication/blob_retriever.rb
View file @
e8edb60d
...
...
@@ -19,7 +19,7 @@ module Gitlab
def
execute
return
error
(
"
#{
replicator
.
replicable_name
}
not found"
)
unless
recorded_file
return
file_not_found
(
recorded_file
)
unless
replicator
.
file_exist?
return
file_not_found
(
recorded_file
)
unless
replicator
.
file_exist
s
?
return
error
(
'Checksum mismatch'
)
unless
matches_checksum?
success
(
replicator
.
carrierwave_uploader
)
...
...
ee/spec/support/shared_examples/models/concerns/blob_replicator_strategy_shared_examples.rb
View file @
e8edb60d
...
...
@@ -182,7 +182,7 @@ RSpec.shared_examples 'a blob replicator' do
context
'when the file does not exist'
do
it
'raises an error'
do
allow
(
subject
).
to
receive
(
:file_exist?
).
and_return
(
false
)
allow
(
subject
).
to
receive
(
:file_exist
s
?
).
and_return
(
false
)
expect
{
subject
.
calculate_checksum
}.
to
raise_error
(
'File is not checksummable'
)
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