Commit 9ce2cc76 authored by Zeger-Jan van de Weg's avatar Zeger-Jan van de Weg

Fix encoding issues when name is not UTF-8

parent bb746f7b
......@@ -155,7 +155,10 @@ module Gitlab
stream = GitalyClient.call(@repository.storage, :ref_service, :list_tag_names_containing_commit, request)
stream.each_with_object([]) { |response, array| array.concat(response.tag_names) }
stream.each_with_object([]) do |response, array|
encoded_names = response.tag_names.map { |t| Gitlab::Git.ref_name(t) }
array.concat(encoded_names)
end
end
# Limit: 0 implies no limit, thus all tag names will be returned
......@@ -168,7 +171,10 @@ module Gitlab
stream = GitalyClient.call(@repository.storage, :ref_service, :list_branch_names_containing_commit, request)
stream.each_with_object([]) { |response, array| array.concat(response.branch_names) }
stream.each_with_object([]) do |response, array|
encoded_names = response.branch_names.map { |b| Gitlab::Git.ref_name(b) }
array.concat(encoded_names)
end
end
private
......
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