diff options
author | Alejandro RodrÃguez <alejorro70@gmail.com> | 2016-07-26 16:55:13 -0400 |
---|---|---|
committer | Alejandro RodrÃguez <alejorro70@gmail.com> | 2016-07-26 16:55:13 -0400 |
commit | 6b1129ccc0e3728acca9434add63d237acfc4744 (patch) | |
tree | ce87981b58125684e8ae03d4530329db865420dc /lib | |
parent | 2e2af9ac3b79aff92afad0f3f8cee60646f1128b (diff) | |
download | gitlab-shell-6b1129ccc0e3728acca9434add63d237acfc4744.tar.gz |
Allow gitlab-project's fork-project command to fork projects between different repository storages
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab_projects.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/gitlab_projects.rb b/lib/gitlab_projects.rb index ad3d3b8..4e6f271 100644 --- a/lib/gitlab_projects.rb +++ b/lib/gitlab_projects.rb @@ -286,6 +286,13 @@ class GitlabProjects end def fork_project + destination_repos_path = ARGV.shift + + unless destination_repos_path + $logger.error "fork-project failed: no destination repository path provided." + return false + end + new_namespace = ARGV.shift # destination namespace must be provided @@ -295,7 +302,7 @@ class GitlabProjects end # destination namespace must exist - namespaced_path = File.join(repos_path, new_namespace) + namespaced_path = File.join(destination_repos_path, new_namespace) unless File.exists?(namespaced_path) $logger.error "fork-project failed: destination namespace <#{namespaced_path}> does not exist." return false |