diff options
author | Drew Blessing <drew@gitlab.com> | 2016-04-05 17:44:13 -0500 |
---|---|---|
committer | Drew Blessing <drew@gitlab.com> | 2016-04-06 14:56:40 -0500 |
commit | 935bf7271d88c8623312004dd6cba791b76503f5 (patch) | |
tree | 3463f6b8d1729bf21b96c2b8c8614cf2e5388bea /app | |
parent | 779b9eac57cf45d77e4d62aa1b96e06928daa794 (diff) | |
download | gitlab-ce-935bf7271d88c8623312004dd6cba791b76503f5.tar.gz |
Only update main language if it is not already setupdate_main_lang_if_unset
Diffstat (limited to 'app')
-rw-r--r-- | app/services/git_push_service.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/services/git_push_service.rb b/app/services/git_push_service.rb index 36c9ee92da1..dc74c02760b 100644 --- a/app/services/git_push_service.rb +++ b/app/services/git_push_service.rb @@ -55,15 +55,15 @@ class GitPushService < BaseService end def update_main_language + # Performance can be bad so for now only check main_language once + # See https://gitlab.com/gitlab-org/gitlab-ce/issues/14937 + return if @project.main_language.present? + return unless is_default_branch? return unless push_to_new_branch? || push_to_existing_branch? current_language = @project.repository.main_language - - unless current_language == @project.main_language - return @project.update_attributes(main_language: current_language) - end - + @project.update_attributes(main_language: current_language) true end |