diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-07-26 21:03:15 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2016-07-26 21:03:15 +0000 |
commit | ccf949e17127d590b8c823d8f678e9b687718dda (patch) | |
tree | ce87981b58125684e8ae03d4530329db865420dc /lib/gitlab_projects.rb | |
parent | 2e2af9ac3b79aff92afad0f3f8cee60646f1128b (diff) | |
parent | 6b1129ccc0e3728acca9434add63d237acfc4744 (diff) | |
download | gitlab-shell-ccf949e17127d590b8c823d8f678e9b687718dda.tar.gz |
Merge branch '51-gitlab-project-s-fork_project-command-doesn-t-work-if-the-project-is-being-forked-to-another-storage' into 'master'
Allow gitlab-project's fork-project command to fork projects between different repository storages
Closes #51
See merge request !75
Diffstat (limited to 'lib/gitlab_projects.rb')
-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 |