summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2015-08-06 00:48:27 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2015-08-06 00:55:34 +0200
commit9d5ebedce36dd52858f1136e6f6a752448bd5868 (patch)
tree152be62ada1745e94b1e9e685ef184913d6baaac /app
parent3890f722d2bdd8964bac776f92772cc447d2b44c (diff)
downloadgitlab-ci-9d5ebedce36dd52858f1136e6f6a752448bd5868.tar.gz
Prefer `failed` commit status over `skipped` if no builds were createdbroken-yaml-errors
Diffstat (limited to 'app')
-rw-r--r--app/models/commit.rb12
1 files changed, 5 insertions, 7 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb
index ec65d19..68057b7 100644
--- a/app/models/commit.rb
+++ b/app/models/commit.rb
@@ -161,15 +161,13 @@ class Commit < ActiveRecord::Base
end
def status
- if skip_ci? || builds.none?
+ if skip_ci?
return 'skipped'
- end
-
- if yaml_errors.present?
+ elsif yaml_errors.present?
return 'failed'
- end
-
- if success?
+ elsif builds.none?
+ return 'skipped'
+ elsif success?
'success'
elsif pending?
'pending'