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
8d7fb292
Commit
8d7fb292
authored
Jun 10, 2019
by
Oswaldo Ferreira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid encoding errors for MergeToRefService
parent
50063f4a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
1 deletion
+24
-1
changelogs/unreleased/osw-avoid-encoding-errors-on-merge-to-ref-service.yml
...sed/osw-avoid-encoding-errors-on-merge-to-ref-service.yml
+5
-0
lib/gitlab/gitaly_client/operation_service.rb
lib/gitlab/gitaly_client/operation_service.rb
+1
-1
spec/lib/gitlab/gitaly_client/operation_service_spec.rb
spec/lib/gitlab/gitaly_client/operation_service_spec.rb
+18
-0
No files found.
changelogs/unreleased/osw-avoid-encoding-errors-on-merge-to-ref-service.yml
0 → 100644
View file @
8d7fb292
---
title
:
Handle encoding errors for MergeToRefService
merge_request
:
29440
author
:
type
:
fixed
lib/gitlab/gitaly_client/operation_service.rb
View file @
8d7fb292
...
...
@@ -107,7 +107,7 @@ module Gitlab
branch:
encode_binary
(
branch
),
target_ref:
encode_binary
(
target_ref
),
user:
Gitlab
::
Git
::
User
.
from_gitlab
(
user
).
to_gitaly
,
message:
message
message:
encode_binary
(
message
)
)
response
=
GitalyClient
.
call
(
@repository
.
storage
,
:operation_service
,
:user_merge_to_ref
,
request
)
...
...
spec/lib/gitlab/gitaly_client/operation_service_spec.rb
View file @
8d7fb292
...
...
@@ -78,6 +78,24 @@ describe Gitlab::GitalyClient::OperationService do
subject
end
describe
'#user_merge_to_ref'
do
let
(
:branch
)
{
'my-branch'
}
let
(
:source_sha
)
{
'cfe32cf61b73a0d5e9f13e774abde7ff789b1660'
}
let
(
:ref
)
{
'refs/merge-requests/x/merge'
}
let
(
:message
)
{
'validación'
}
let
(
:response
)
{
Gitaly
::
UserMergeToRefResponse
.
new
(
commit_id:
'new-commit-id'
)
}
subject
{
client
.
user_merge_to_ref
(
user
,
source_sha
,
branch
,
ref
,
message
)
}
it
'sends a user_merge_to_ref message'
do
expect_any_instance_of
(
Gitaly
::
OperationService
::
Stub
)
.
to
receive
(
:user_merge_to_ref
).
with
(
kind_of
(
Gitaly
::
UserMergeToRefRequest
),
kind_of
(
Hash
))
.
and_return
(
response
)
subject
end
end
context
"when pre_receive_error is present"
do
let
(
:response
)
do
Gitaly
::
UserUpdateBranchResponse
.
new
(
pre_receive_error:
"GitLab: something failed"
)
...
...
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