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
b5e8c205
Commit
b5e8c205
authored
Jun 11, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
f3470a4e
641d3323
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
4 deletions
+28
-4
changelogs/unreleased/sh-fix-utf-8-encoding-resolve-conflicts.yml
...gs/unreleased/sh-fix-utf-8-encoding-resolve-conflicts.yml
+5
-0
lib/gitlab/gitaly_client/conflicts_service.rb
lib/gitlab/gitaly_client/conflicts_service.rb
+3
-3
spec/lib/gitlab/gitaly_client/conflicts_service_spec.rb
spec/lib/gitlab/gitaly_client/conflicts_service_spec.rb
+20
-1
No files found.
changelogs/unreleased/sh-fix-utf-8-encoding-resolve-conflicts.yml
0 → 100644
View file @
b5e8c205
---
title
:
Fix UTF-8 conversion issues when resolving conflicts
merge_request
:
29453
author
:
type
:
fixed
lib/gitlab/gitaly_client/conflicts_service.rb
View file @
b5e8c205
...
...
@@ -65,9 +65,9 @@ module Gitlab
our_commit_oid:
@our_commit_oid
,
target_repository:
target_repository
.
gitaly_repository
,
their_commit_oid:
@their_commit_oid
,
source_branch:
source_branch
,
target_branch:
target_branch
,
commit_message:
resolution
.
commit_message
,
source_branch:
encode_binary
(
source_branch
)
,
target_branch:
encode_binary
(
target_branch
)
,
commit_message:
encode_binary
(
resolution
.
commit_message
)
,
user:
Gitlab
::
Git
::
User
.
from_gitlab
(
resolution
.
user
).
to_gitaly
)
end
...
...
spec/lib/gitlab/gitaly_client/conflicts_service_spec.rb
View file @
b5e8c205
...
...
@@ -35,7 +35,7 @@ describe Gitlab::GitalyClient::ConflictsService do
end
let
(
:source_branch
)
{
'master'
}
let
(
:target_branch
)
{
'feature'
}
let
(
:commit_message
)
{
'Solving conflicts'
}
let
(
:commit_message
)
{
'Solving conflicts
\n\nTést
'
}
let
(
:resolution
)
do
Gitlab
::
Git
::
Conflict
::
Resolution
.
new
(
user
,
files
,
commit_message
)
end
...
...
@@ -51,6 +51,25 @@ describe Gitlab::GitalyClient::ConflictsService do
subject
end
context
'with branches with UTF-8 characters'
do
let
(
:source_branch
)
{
'testòbranch'
}
let
(
:target_branch
)
{
'ábranch'
}
it
'handles commit messages with UTF-8 characters'
do
allow
(
::
Gitlab
::
GitalyClient
).
to
receive
(
:call
).
and_call_original
expect
(
::
Gitlab
::
GitalyClient
).
to
receive
(
:call
).
with
(
anything
,
:conflicts_service
,
:resolve_conflicts
,
any_args
)
do
|*
args
|
# Force the generation of request messages by iterating through the enumerator
message
=
args
[
3
].
to_a
.
first
params
=
[
message
.
header
.
commit_message
,
message
.
header
.
source_branch
,
message
.
header
.
target_branch
]
expect
(
params
.
map
(
&
:encoding
).
uniq
).
to
eq
([
Encoding
::
ASCII_8BIT
])
double
(
resolution_error:
nil
)
end
subject
end
end
it
'raises a relevant exception if resolution_error is present'
do
expect_any_instance_of
(
Gitaly
::
ConflictsService
::
Stub
).
to
receive
(
:resolve_conflicts
)
.
with
(
kind_of
(
Enumerator
),
kind_of
(
Hash
)).
and_return
(
double
(
resolution_error:
"something happened"
))
...
...
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