diff options
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/project.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index f94cbdd75a4..1eed164f3e2 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -1322,7 +1322,7 @@ class Project < ApplicationRecord # Check if repository with same path already exists on disk we can # skip this for the hashed storage because the path does not change - if legacy_storage? && repository_with_same_path_already_exists? + if legacy_storage? errors.add(:base, _('There is already a repository with that name on disk')) return false end @@ -2204,16 +2204,12 @@ class Project < ApplicationRecord def check_repository_absence! return if skip_disk_validation - if repository_storage.blank? || repository_with_same_path_already_exists? + if repository_storage.blank? errors.add(:base, _('There is already a repository with that name on disk')) throw :abort end end - def repository_with_same_path_already_exists? - gitlab_shell.exists?(repository_storage, "#{disk_path}.git") - end - def set_timestamps_for_create update_columns(last_activity_at: self.created_at, last_repository_updated_at: self.created_at) end |