diff options
author | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2018-01-05 13:29:04 +0100 |
---|---|---|
committer | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2018-01-09 19:23:18 +0100 |
commit | 58e17bf3b04f7bd63bca6b36a44b61ff2851f99e (patch) | |
tree | faa0e241564195cb2f1d5bc8065455c3f8803d24 /lib/gitlab/git | |
parent | 7b2f9af4486b26512a2fefb3f385a2b8fa65a068 (diff) | |
download | gitlab-ce-58e17bf3b04f7bd63bca6b36a44b61ff2851f99e.tar.gz |
Migrate GitlabProject (re)move project endpoints
Migration is done through a small refactoring, which makes us call
endpoins which are performing the same actions for namespaces.
Tests are added to ensure only the project is removed that should be
removed.
Closes gitlab-org/gitaly#873
Diffstat (limited to 'lib/gitlab/git')
-rw-r--r-- | lib/gitlab/git/gitlab_projects.rb | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/lib/gitlab/git/gitlab_projects.rb b/lib/gitlab/git/gitlab_projects.rb index cba638c06db..976fa1ddfe6 100644 --- a/lib/gitlab/git/gitlab_projects.rb +++ b/lib/gitlab/git/gitlab_projects.rb @@ -41,36 +41,6 @@ module Gitlab io.read end - def rm_project - logger.info "Removing repository <#{repository_absolute_path}>." - FileUtils.rm_rf(repository_absolute_path) - end - - # Move repository from one directory to another - # - # Example: gitlab/gitlab-ci.git -> randx/six.git - # - # Won't work if target namespace directory does not exist - # - def mv_project(new_path) - new_absolute_path = File.join(shard_path, new_path) - - # verify that the source repo exists - unless File.exist?(repository_absolute_path) - logger.error "mv-project failed: source path <#{repository_absolute_path}> does not exist." - return false - end - - # ...and that the target repo does not exist - if File.exist?(new_absolute_path) - logger.error "mv-project failed: destination path <#{new_absolute_path}> already exists." - return false - end - - logger.info "Moving repository from <#{repository_absolute_path}> to <#{new_absolute_path}>." - FileUtils.mv(repository_absolute_path, new_absolute_path) - end - # Import project via git clone --bare # URL must be publicly cloneable def import_project(source, timeout) |