diff options
Diffstat (limited to 'app/models/repository.rb')
-rw-r--r-- | app/models/repository.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb index e639a389e0a..5ab35ed1ef9 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -28,6 +28,9 @@ class Repository #{REF_PIPELINES} ].freeze + FORMAT_SHA1 = 'sha1' + FORMAT_SHA256 = 'sha256' + include Gitlab::RepositoryCacheAdapter attr_accessor :full_path, :shard, :disk_path, :container, :repo_type @@ -676,6 +679,10 @@ class Repository end cache_method :gitlab_ci_yml + def jenkinsfile? + file_on_head(:jenkinsfile).present? + end + def xcode_project? file_on_head(:xcode_config, :tree).present? end @@ -1271,6 +1278,17 @@ class Repository .map(&:to_h) end + def object_format + return unless exists? + + case raw.object_format + when :OBJECT_FORMAT_SHA1 + FORMAT_SHA1 + when :OBJECT_FORMAT_SHA256 + FORMAT_SHA256 + end + end + private def ancestor_cache_key(ancestor_id, descendant_id) |