From 6b1129ccc0e3728acca9434add63d237acfc4744 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Rodr=C3=ADguez?= Date: Tue, 26 Jul 2016 16:55:13 -0400 Subject: Allow gitlab-project's fork-project command to fork projects between different repository storages --- lib/gitlab_projects.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lib') 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 -- cgit v1.2.1