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
e892eeb5
Commit
e892eeb5
authored
Apr 05, 2018
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add calculate_checksum method to the Gitaly repository client
parent
b81c6f14
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
lib/gitlab/gitaly_client/repository_service.rb
lib/gitlab/gitaly_client/repository_service.rb
+6
-0
spec/lib/gitlab/gitaly_client/repository_service_spec.rb
spec/lib/gitlab/gitaly_client/repository_service_spec.rb
+11
-0
No files found.
lib/gitlab/gitaly_client/repository_service.rb
View file @
e892eeb5
...
...
@@ -262,6 +262,12 @@ module Gitlab
response
.
license_short_name
.
presence
end
def
calculate_checksum
request
=
Gitaly
::
CalculateChecksumRequest
.
new
(
repository:
@gitaly_repo
)
response
=
GitalyClient
.
call
(
@storage
,
:repository_service
,
:calculate_checksum
,
request
)
response
.
checksum
.
presence
end
end
end
end
spec/lib/gitlab/gitaly_client/repository_service_spec.rb
View file @
e892eeb5
...
...
@@ -134,4 +134,15 @@ describe Gitlab::GitalyClient::RepositoryService do
client
.
squash_in_progress?
(
squash_id
)
end
end
describe
'#calculate_checksum'
do
it
'sends a calculate_checksum message'
do
expect_any_instance_of
(
Gitaly
::
RepositoryService
::
Stub
)
.
to
receive
(
:calculate_checksum
)
.
with
(
gitaly_request_with_path
(
storage_name
,
relative_path
),
kind_of
(
Hash
))
.
and_return
(
double
(
checksum:
0
))
client
.
calculate_checksum
end
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