Commit 51f047aa authored by Douwe Maan's avatar Douwe Maan

Merge branch 'zj-missing-part-linguist' into 'master'

Remove Languages feature gate

See merge request gitlab-org/gitlab-ce!20128
parents c73ecd32 af20d781
......@@ -978,29 +978,8 @@ module Gitlab
end
def languages(ref = nil)
gitaly_migrate(:commit_languages, status: Gitlab::GitalyClient::MigrationStatus::OPT_OUT) do |is_enabled|
if is_enabled
gitaly_commit_client.languages(ref)
else
ref ||= rugged.head.target_id
languages = Linguist::Repository.new(rugged, ref).languages
total = languages.map(&:last).sum
languages = languages.map do |language|
name, share = language
color = Linguist::Language[name].color || "##{Digest::SHA256.hexdigest(name)[0...6]}"
{
value: (share.to_f * 100 / total).round(2),
label: name,
color: color,
highlight: color
}
end
languages.sort do |x, y|
y[:value] <=> x[:value]
end
end
wrapped_gitaly_errors do
gitaly_commit_client.languages(ref)
end
end
......
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