summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2017-03-22 18:22:34 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2017-03-28 17:50:28 +0200
commitbb910c3b46fa9dde47ea3377d4463c0eae5149c7 (patch)
tree7f8b764936efc91ab89a89b31db88ef153cedeb4 /app/models
parentd70f9c85631ec16523528eabf6f470619bf7969a (diff)
downloadgitlab-ce-bb910c3b46fa9dde47ea3377d4463c0eae5149c7.tar.gz
Make CI build to use optimistic locking only on status change
Diffstat (limited to 'app/models')
-rw-r--r--app/models/commit_status.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb
index 8c71267da65..17b322b5ae3 100644
--- a/app/models/commit_status.rb
+++ b/app/models/commit_status.rb
@@ -105,6 +105,10 @@ class CommitStatus < ActiveRecord::Base
end
end
+ def locking_enabled?
+ status_changed?
+ end
+
def before_sha
pipeline.before_sha || Gitlab::Git::BLANK_SHA
end