summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2019-07-10 16:07:14 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2019-07-10 16:07:14 +0200
commit49f8697a4966affd27a49ee697dd4d72f6003e13 (patch)
tree4dd52ac77af5d081cd50d04ddd5a2aaaf62958a0 /app
parent356bf3afffbe3c75da071a1e0ee28daa6951d187 (diff)
downloadgitlab-ce-49f8697a4966affd27a49ee697dd4d72f6003e13.tar.gz
Add additional test case for Gitaly N+1 for diff files
Diffstat (limited to 'app')
-rw-r--r--app/models/environment_status.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/environment_status.rb b/app/models/environment_status.rb
index 465a42759df..d7dc64190d6 100644
--- a/app/models/environment_status.rb
+++ b/app/models/environment_status.rb
@@ -40,7 +40,7 @@ class EnvironmentStatus
end
def changes
- return [] if project.route_map_for(sha).nil?
+ return [] unless has_route_map?
changed_files.map { |file| build_change(file) }.compact
end
@@ -50,6 +50,10 @@ class EnvironmentStatus
.merge_request_diff_files.where(deleted_file: false)
end
+ def has_route_map?
+ project.route_map_for(sha).present?
+ end
+
private
PAGE_EXTENSIONS = /\A\.(s?html?|php|asp|cgi|pl)\z/i.freeze