summaryrefslogtreecommitdiff
path: root/app/models/ci/commit.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/ci/commit.rb')
-rw-r--r--app/models/ci/commit.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/models/ci/commit.rb b/app/models/ci/commit.rb
index ccd26959ad1..7e6bb4f8c1b 100644
--- a/app/models/ci/commit.rb
+++ b/app/models/ci/commit.rb
@@ -13,7 +13,7 @@ module Ci
validate :valid_commit_sha
# Invalidate object and save if when touched
- after_touch :update_state!
+ after_touch :update_state
def self.truncate_sha(sha)
sha[0...8]
@@ -159,7 +159,9 @@ module Ci
git_commit_message =~ /(\[ci skip\])/ if git_commit_message
end
- def update_state!
+ private
+
+ def update_state
statuses.reload
self.status = if yaml_errors.blank?
statuses.latest.status || 'skipped'