diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-09 09:06:19 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-09 09:06:19 +0000 |
commit | 3744bcc0d10d24104e39985b6833a0ec51791c0a (patch) | |
tree | ecad3a8435a74bd618acd591762906429f88bfd4 /app/services/projects | |
parent | 78adf0c5cc2534908e3f16a9b8abf06509444cf3 (diff) | |
download | gitlab-ce-3744bcc0d10d24104e39985b6833a0ec51791c0a.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/projects')
-rw-r--r-- | app/services/projects/destroy_service.rb | 4 | ||||
-rw-r--r-- | app/services/projects/hashed_storage/base_repository_service.rb | 10 |
2 files changed, 4 insertions, 10 deletions
diff --git a/app/services/projects/destroy_service.rb b/app/services/projects/destroy_service.rb index 5fdf98c3c5e..90e703e7050 100644 --- a/app/services/projects/destroy_service.rb +++ b/app/services/projects/destroy_service.rb @@ -123,11 +123,9 @@ module Projects mv_repository(old_path, new_path) end - # rubocop: disable CodeReuse/ActiveRecord def repo_exists?(path) - gitlab_shell.exists?(project.repository_storage, path + '.git') + gitlab_shell.repository_exists?(project.repository_storage, path + '.git') end - # rubocop: enable CodeReuse/ActiveRecord def mv_repository(from_path, to_path) return true unless repo_exists?(from_path) diff --git a/app/services/projects/hashed_storage/base_repository_service.rb b/app/services/projects/hashed_storage/base_repository_service.rb index f97a28b8c3b..b7e9d3e8791 100644 --- a/app/services/projects/hashed_storage/base_repository_service.rb +++ b/app/services/projects/hashed_storage/base_repository_service.rb @@ -20,16 +20,13 @@ module Projects protected - # rubocop: disable CodeReuse/ActiveRecord def has_wiki? - gitlab_shell.exists?(project.repository_storage, "#{old_wiki_disk_path}.git") + gitlab_shell.repository_exists?(project.repository_storage, "#{old_wiki_disk_path}.git") end - # rubocop: enable CodeReuse/ActiveRecord - # rubocop: disable CodeReuse/ActiveRecord def move_repository(from_name, to_name) - from_exists = gitlab_shell.exists?(project.repository_storage, "#{from_name}.git") - to_exists = gitlab_shell.exists?(project.repository_storage, "#{to_name}.git") + from_exists = gitlab_shell.repository_exists?(project.repository_storage, "#{from_name}.git") + to_exists = gitlab_shell.repository_exists?(project.repository_storage, "#{to_name}.git") # If we don't find the repository on either original or target we should log that as it could be an issue if the # project was not originally empty. @@ -46,7 +43,6 @@ module Projects gitlab_shell.mv_repository(project.repository_storage, from_name, to_name) end - # rubocop: enable CodeReuse/ActiveRecord def rollback_folder_move move_repository(new_disk_path, old_disk_path) |