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
Léo-Paul Géneau
gitlab-ce
Commits
d6066870
Commit
d6066870
authored
Nov 02, 2017
by
Kim Carlbäcker
Committed by
Douwe Maan
Nov 02, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix encoding issue with Repository.ls_files
parent
e54dd249
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
8 additions
and
1 deletion
+8
-1
lib/gitlab/gitaly_client/commit_service.rb
lib/gitlab/gitaly_client/commit_service.rb
+1
-1
spec/lib/gitlab/git/repository_spec.rb
spec/lib/gitlab/git/repository_spec.rb
+5
-0
spec/support/gitlab-git-test.git/objects/88/3e379fcaa5f818fca81cdbabd7a497794d6535
...est.git/objects/88/3e379fcaa5f818fca81cdbabd7a497794d6535
+0
-0
spec/support/gitlab-git-test.git/objects/c8/b1ab16c858c67b680eea4644cf652485f555cf
...est.git/objects/c8/b1ab16c858c67b680eea4644cf652485f555cf
+0
-0
spec/support/gitlab-git-test.git/objects/e3/7697aea12699f0b44544332a7c0f41ace5fb16
...est.git/objects/e3/7697aea12699f0b44544332a7c0f41ace5fb16
+2
-0
spec/support/gitlab-git-test.git/objects/eb/a0c153ed20d927bab00507f356043b6b4be31e
...est.git/objects/eb/a0c153ed20d927bab00507f356043b6b4be31e
+0
-0
spec/support/gitlab-git-test.git/objects/f6/5ad228d96e2a2ae7088e8557fe8906f6dd2b3f
...est.git/objects/f6/5ad228d96e2a2ae7088e8557fe8906f6dd2b3f
+0
-0
No files found.
lib/gitlab/gitaly_client/commit_service.rb
View file @
d6066870
...
@@ -18,7 +18,7 @@ module Gitlab
...
@@ -18,7 +18,7 @@ module Gitlab
response
=
GitalyClient
.
call
(
@repository
.
storage
,
:commit_service
,
:list_files
,
request
)
response
=
GitalyClient
.
call
(
@repository
.
storage
,
:commit_service
,
:list_files
,
request
)
response
.
flat_map
do
|
msg
|
response
.
flat_map
do
|
msg
|
msg
.
paths
.
map
{
|
d
|
d
.
dup
.
force_encoding
(
Encoding
::
UTF_8
)
}
msg
.
paths
.
map
{
|
d
|
EncodingHelper
.
encode!
(
d
.
dup
)
}
end
end
end
end
...
...
spec/lib/gitlab/git/repository_spec.rb
View file @
d6066870
...
@@ -1163,6 +1163,7 @@ describe Gitlab::Git::Repository, seed_helper: true do
...
@@ -1163,6 +1163,7 @@ describe Gitlab::Git::Repository, seed_helper: true do
describe
"#ls_files"
do
describe
"#ls_files"
do
let
(
:master_file_paths
)
{
repository
.
ls_files
(
"master"
)
}
let
(
:master_file_paths
)
{
repository
.
ls_files
(
"master"
)
}
let
(
:utf8_file_paths
)
{
repository
.
ls_files
(
"ls-files-utf8"
)
}
let
(
:not_existed_branch
)
{
repository
.
ls_files
(
"not_existed_branch"
)
}
let
(
:not_existed_branch
)
{
repository
.
ls_files
(
"not_existed_branch"
)
}
it
"read every file paths of master branch"
do
it
"read every file paths of master branch"
do
...
@@ -1184,6 +1185,10 @@ describe Gitlab::Git::Repository, seed_helper: true do
...
@@ -1184,6 +1185,10 @@ describe Gitlab::Git::Repository, seed_helper: true do
it
"returns empty array when not existed branch"
do
it
"returns empty array when not existed branch"
do
expect
(
not_existed_branch
.
length
).
to
equal
(
0
)
expect
(
not_existed_branch
.
length
).
to
equal
(
0
)
end
end
it
"returns valid utf-8 data"
do
expect
(
utf8_file_paths
.
map
{
|
file
|
file
.
force_encoding
(
'utf-8'
)
}).
to
all
(
be_valid_encoding
)
end
end
end
describe
"#copy_gitattributes"
do
describe
"#copy_gitattributes"
do
...
...
spec/support/gitlab-git-test.git/objects/88/3e379fcaa5f818fca81cdbabd7a497794d6535
0 → 100644
View file @
d6066870
File added
spec/support/gitlab-git-test.git/objects/c8/b1ab16c858c67b680eea4644cf652485f555cf
0 → 100644
View file @
d6066870
File added
spec/support/gitlab-git-test.git/objects/e3/7697aea12699f0b44544332a7c0f41ace5fb16
0 → 100644
View file @
d6066870
xK
0EgNI|ADt*^ mZ qGčY8ZK7"Fc%oHD9rZLsMJ2=ACmeFgVxI9H2XJrp6;N8z??>+zWƏBÞf}bN@K\SYiSC
\ No newline at end of file
spec/support/gitlab-git-test.git/objects/eb/a0c153ed20d927bab00507f356043b6b4be31e
0 → 100644
View file @
d6066870
File added
spec/support/gitlab-git-test.git/objects/f6/5ad228d96e2a2ae7088e8557fe8906f6dd2b3f
0 → 100644
View file @
d6066870
File added
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