Commit 8aac719f authored by Robert Speicher's avatar Robert Speicher

Merge branch 'fix/gitaly-commit-diff-rpc-encoding-error' into 'master'

Encode paths properly for Gitaly Commit{Diff,Delta}

Closes gitaly#589

See merge request gitlab-org/gitlab-ce!14361
parents d15109dc 28d95e10
...@@ -221,7 +221,7 @@ module Gitlab ...@@ -221,7 +221,7 @@ module Gitlab
repository: @gitaly_repo, repository: @gitaly_repo,
left_commit_id: parent_id, left_commit_id: parent_id,
right_commit_id: commit.id, right_commit_id: commit.id,
paths: options.fetch(:paths, []) paths: options.fetch(:paths, []).map { |path| GitalyClient.encode(path) }
} }
end end
......
...@@ -51,6 +51,10 @@ describe Gitlab::GitalyClient::CommitService do ...@@ -51,6 +51,10 @@ describe Gitlab::GitalyClient::CommitService do
expect(ret).to be_kind_of(Gitlab::GitalyClient::DiffStitcher) expect(ret).to be_kind_of(Gitlab::GitalyClient::DiffStitcher)
end end
it 'encodes paths correctly' do
expect { client.diff_from_parent(commit, paths: ['encoding/test.txt', 'encoding/テスト.txt']) }.not_to raise_error
end
end end
describe '#commit_deltas' do describe '#commit_deltas' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment