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.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/models/ci/commit.rb b/app/models/ci/commit.rb
index 687654d3c89..7991b987e35 100644
--- a/app/models/ci/commit.rb
+++ b/app/models/ci/commit.rb
@@ -94,6 +94,13 @@ module Ci
end
end
+ def latest?
+ return false unless ref
+ commit = project.commit(ref)
+ return false unless commit
+ commit.sha == sha
+ end
+
def triggered?
trigger_requests.any?
end