diff options
author | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2016-02-02 16:35:09 +0300 |
---|---|---|
committer | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2016-02-02 16:35:09 +0300 |
commit | 0a4db90d36870211df2dc1e606b01602666706c8 (patch) | |
tree | 69f5758ac0bb01051380159fa53c6f30b70eaf76 | |
parent | c76e6b982bb171f24592b62264b28eb3fbe1bafc (diff) |
Use begin/end instead of defined?
-rw-r--r-- | app/models/ci/commit.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/models/ci/commit.rb b/app/models/ci/commit.rb index 96786ac4573..ecbd2078b1d 100644 --- a/app/models/ci/commit.rb +++ b/app/models/ci/commit.rb @@ -205,11 +205,11 @@ module Ci end def ci_yaml_file - return @ci_yaml_file if defined?(@ci_yaml_file) - - blob = project.repository.blob_at(sha, '.gitlab-ci.yml') - blob.load_all_data!(project.repository) - @ci_yaml_file = blob.data + @ci_yaml_file ||= begin + blob = project.repository.blob_at(sha, '.gitlab-ci.yml') + blob.load_all_data!(project.repository) + blob.data + end rescue nil end |