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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
df650eaa
Commit
df650eaa
authored
Jun 10, 2019
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Force source and target branch to binary mode
parent
1edf1807
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
10 deletions
+17
-10
lib/gitlab/gitaly_client/conflicts_service.rb
lib/gitlab/gitaly_client/conflicts_service.rb
+2
-2
spec/lib/gitlab/gitaly_client/conflicts_service_spec.rb
spec/lib/gitlab/gitaly_client/conflicts_service_spec.rb
+15
-8
No files found.
lib/gitlab/gitaly_client/conflicts_service.rb
View file @
df650eaa
...
@@ -65,8 +65,8 @@ module Gitlab
...
@@ -65,8 +65,8 @@ module Gitlab
our_commit_oid:
@our_commit_oid
,
our_commit_oid:
@our_commit_oid
,
target_repository:
target_repository
.
gitaly_repository
,
target_repository:
target_repository
.
gitaly_repository
,
their_commit_oid:
@their_commit_oid
,
their_commit_oid:
@their_commit_oid
,
source_branch:
source_branch
,
source_branch:
encode_binary
(
source_branch
)
,
target_branch:
target_branch
,
target_branch:
encode_binary
(
target_branch
)
,
commit_message:
encode_binary
(
resolution
.
commit_message
),
commit_message:
encode_binary
(
resolution
.
commit_message
),
user:
Gitlab
::
Git
::
User
.
from_gitlab
(
resolution
.
user
).
to_gitaly
user:
Gitlab
::
Git
::
User
.
from_gitlab
(
resolution
.
user
).
to_gitaly
)
)
...
...
spec/lib/gitlab/gitaly_client/conflicts_service_spec.rb
View file @
df650eaa
...
@@ -51,16 +51,23 @@ describe Gitlab::GitalyClient::ConflictsService do
...
@@ -51,16 +51,23 @@ describe Gitlab::GitalyClient::ConflictsService do
subject
subject
end
end
it
'handles commit messages with UTF-8 characters'
do
context
'with branches with UTF-8 characters'
do
allow
(
::
Gitlab
::
GitalyClient
).
to
receive
(
:call
).
and_call_original
let
(
:source_branch
)
{
'testòbranch'
}
expect
(
::
Gitlab
::
GitalyClient
).
to
receive
(
:call
).
with
(
anything
,
:conflicts_service
,
:resolve_conflicts
,
any_args
)
do
|*
args
|
let
(
:target_branch
)
{
'ábranch'
}
# Force the generation of request messages by iterating through the enumerator
args
[
3
].
to_a
double
(
resolution_error:
nil
)
it
'handles commit messages with UTF-8 characters'
do
end
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
])
subject
double
(
resolution_error:
nil
)
end
subject
end
end
end
it
'raises a relevant exception if resolution_error is present'
do
it
'raises a relevant exception if resolution_error is present'
do
...
...
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