diff options
Diffstat (limited to 'app/models/project.rb')
-rw-r--r-- | app/models/project.rb | 73 |
1 files changed, 1 insertions, 72 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index 54bed41e9e7..31aeb0146df 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -19,6 +19,7 @@ class Project < ApplicationRecord include ProjectFeaturesCompatibility include SelectForProjectAuthorization include Presentable + include HasRepository include Routable include GroupDescendant include Gitlab::SQL::Pattern @@ -326,7 +327,6 @@ class Project < ApplicationRecord to: :project_feature, allow_nil: true delegate :scheduled?, :started?, :in_progress?, :failed?, :finished?, prefix: :import, to: :import_state, allow_nil: true - delegate :base_dir, :disk_path, to: :storage delegate :no_import?, to: :import_state, allow_nil: true delegate :name, to: :owner, allow_nil: true, prefix: true delegate :members, to: :team, prefix: true @@ -767,10 +767,6 @@ class Project < ApplicationRecord Feature.enabled?(:context_commits, default_enabled: true) end - def empty_repo? - repository.empty? - end - def team @team ||= ProjectTeam.new(self) end @@ -798,18 +794,6 @@ class Project < ApplicationRecord has_root_container_repository_tags? end - def commit(ref = 'HEAD') - repository.commit(ref) - end - - def commit_by(oid:) - repository.commit_by(oid: oid) - end - - def commits_by(oids:) - repository.commits_by(oids: oids) - end - # ref can't be HEAD, can only be branch/tag name def latest_successful_build_for_ref(job_name, ref = default_branch) return unless ref @@ -1357,48 +1341,6 @@ class Project < ApplicationRecord services.public_send(hooks_scope).any? # rubocop:disable GitlabSecurity/PublicSend end - def valid_repo? - repository.exists? - rescue - errors.add(:path, _('Invalid repository path')) - false - end - - def url_to_repo - gitlab_shell.url_to_repo(full_path) - end - - def repo_exists? - strong_memoize(:repo_exists) do - repository.exists? - rescue - false - end - end - - def root_ref?(branch) - repository.root_ref == branch - end - - def ssh_url_to_repo - url_to_repo - end - - def http_url_to_repo - custom_root = Gitlab::CurrentSettings.custom_http_clone_url_root - - project_url = if custom_root.present? - Gitlab::Utils.append_path( - custom_root, - web_url(only_path: true) - ) - else - web_url - end - - "#{project_url}.git" - end - # Is overridden in EE def lfs_http_url_to_repo(_) http_url_to_repo @@ -1538,15 +1480,6 @@ class Project < ApplicationRecord end end - def default_branch - @default_branch ||= repository.root_ref - end - - def reload_default_branch - @default_branch = nil - default_branch - end - def visibility_level_field :visibility_level end @@ -1583,10 +1516,6 @@ class Project < ApplicationRecord create_repository(force: true) unless repository_exists? end - def repository_exists? - !!repository.exists? - end - def wiki_repository_exists? wiki.repository_exists? end |