diff options
author | Eirik Lygre <eirik.lygre@gmail.com> | 2015-12-09 15:07:10 +0100 |
---|---|---|
committer | Eirik Lygre <eirik.lygre@gmail.com> | 2015-12-09 15:07:10 +0100 |
commit | bb79573c01ad77d6b52245d3af262bc56f79693f (patch) | |
tree | 1bd51c1c8adc50462f22591d6ab5af8315cf9eb6 /app/models/ci/commit.rb | |
parent | 94dc9ef9e1a85b8a4506358479a549dc3a1306b6 (diff) | |
parent | 9bfd6c44e23754b6f699586f6a0cec2879e107e0 (diff) | |
download | gitlab-ce-bb79573c01ad77d6b52245d3af262bc56f79693f.tar.gz |
Merge branch 'master' into default_clone_protocol_based_on_user_keys
Diffstat (limited to 'app/models/ci/commit.rb')
-rw-r--r-- | app/models/ci/commit.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/app/models/ci/commit.rb b/app/models/ci/commit.rb index 971e899de84..75465685e98 100644 --- a/app/models/ci/commit.rb +++ b/app/models/ci/commit.rb @@ -165,6 +165,14 @@ module Ci status == 'canceled' end + def active? + running? || pending? + end + + def complete? + canceled? || success? || failed? + end + def duration duration_array = latest_statuses.map(&:duration).compact duration_array.reduce(:+).to_i @@ -199,7 +207,7 @@ module Ci end def ci_yaml_file - gl_project.repository.blob_at(sha, '.gitlab-ci.yml').data + @ci_yaml_file ||= gl_project.repository.blob_at(sha, '.gitlab-ci.yml').data rescue nil end |