From f5d24e60f842096f670593fb4dd0d29c3f5d4fcc Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Wed, 13 Apr 2016 13:01:08 +0200 Subject: Pipeline view --- app/models/ci/commit.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'app/models/ci/commit.rb') 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 -- cgit v1.2.1