diff options
author | Robert Speicher <robert@gitlab.com> | 2018-05-09 19:20:01 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2018-05-09 19:20:01 +0000 |
commit | 149e91b50ea6944577a1392d487334854ec58012 (patch) | |
tree | e2068cf3ede6bca31dfb8a07199098aa5cf34a48 /app/models | |
parent | 846a80eba178e155c5ab1def1f36e778b7eab837 (diff) | |
parent | f6ecb72682000f7261219bbb6ce1ca9352aa473e (diff) | |
download | gitlab-ce-149e91b50ea6944577a1392d487334854ec58012.tar.gz |
Merge branch 'dm-repository-xcode-project' into 'master'
Add Repository#xcode_project? method
See merge request gitlab-org/gitlab-ce!18854
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/repository.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb index b75c4aca982..44c6bff6b66 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -37,7 +37,7 @@ class Repository changelog license_blob license_key gitignore koding_yml gitlab_ci_yml branch_names tag_names branch_count tag_count avatar exists? root_ref has_visible_content? - issue_template_names merge_request_template_names).freeze + issue_template_names merge_request_template_names xcode_project?).freeze # Methods that use cache_method but only memoize the value MEMOIZED_CACHED_METHODS = %i(license).freeze @@ -55,7 +55,8 @@ class Repository gitlab_ci: :gitlab_ci_yml, avatar: :avatar, issue_template: :issue_template_names, - merge_request_template: :merge_request_template_names + merge_request_template: :merge_request_template_names, + xcode_config: :xcode_project? }.freeze def initialize(full_path, project, disk_path: nil, is_wiki: false) @@ -594,6 +595,11 @@ class Repository end cache_method :gitlab_ci_yml + def xcode_project? + file_on_head(:xcode_config).present? + end + cache_method :xcode_project? + def head_commit @head_commit ||= commit(self.root_ref) end |