diff options
author | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2016-02-01 10:41:52 +0100 |
---|---|---|
committer | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2016-02-01 10:41:52 +0100 |
commit | 64c8ee47c96d9245081abdf1b9d4ec39cdfc5883 (patch) | |
tree | e5eebf2bfef186c7caa6d9b91fae18798657bfaf /app/models/ci/commit.rb | |
parent | 481644ca7c9f763d4646ad557cc3bcf8f4f71816 (diff) | |
download | gitlab-ce-64c8ee47c96d9245081abdf1b9d4ec39cdfc5883.tar.gz |
WIP lazy blobs
Diffstat (limited to 'app/models/ci/commit.rb')
-rw-r--r-- | app/models/ci/commit.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/ci/commit.rb b/app/models/ci/commit.rb index d2a29236942..96786ac4573 100644 --- a/app/models/ci/commit.rb +++ b/app/models/ci/commit.rb @@ -205,7 +205,11 @@ module Ci end def ci_yaml_file - @ci_yaml_file ||= project.repository.blob_at(sha, '.gitlab-ci.yml').data + 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 rescue nil end |