summaryrefslogtreecommitdiff
path: root/lib/gitlab/checks/commit_check.rb
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2018-02-19 15:50:54 +0000
committerSean McGivern <sean@mcgivern.me.uk>2018-02-19 15:50:54 +0000
commitfb2a76ac484f5bba305abdf7b54a18ee8133f63f (patch)
treee72e8e51cf2386223dc9caae5bc653f682d9e697 /lib/gitlab/checks/commit_check.rb
parent31b38ac904f3c897ac520f9b27567deb4255c45f (diff)
parentd4dfa342c1f5a916d325e198ff19d3f702bfb3d9 (diff)
downloadgitlab-ce-fb2a76ac484f5bba305abdf7b54a18ee8133f63f.tar.gz
Merge branch 'jej/avoid-slow-file-lock-checks' into 'master'
Avoid slow File Lock checks when not used Closes #43339 See merge request gitlab-org/gitlab-ce!17140
Diffstat (limited to 'lib/gitlab/checks/commit_check.rb')
-rw-r--r--lib/gitlab/checks/commit_check.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/gitlab/checks/commit_check.rb b/lib/gitlab/checks/commit_check.rb
index ae0cd142378..43a52b493bb 100644
--- a/lib/gitlab/checks/commit_check.rb
+++ b/lib/gitlab/checks/commit_check.rb
@@ -35,14 +35,14 @@ module Gitlab
end
end
- private
-
def validate_lfs_file_locks?
strong_memoize(:validate_lfs_file_locks) do
project.lfs_enabled? && project.lfs_file_locks.any? && newrev && oldrev
end
end
+ private
+
def lfs_file_locks_validation
lambda do |paths|
lfs_lock = project.lfs_file_locks.where(path: paths).where.not(user_id: user.id).first