summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAngus MacArthur <amacarthur@blackberry.com>2013-03-19 11:37:50 -0400
committerAngus MacArthur <amacarthur@blackberry.com>2013-04-15 01:54:52 -0400
commitae33fdf297e03866ecc6c31c5470dd5ad72d1328 (patch)
tree6b3b8fb315fbc3e0b6ebf6dbb527abe9bcb3d245 /lib
parente996c52636f46b193b5ff7291e9b835c317e5438 (diff)
downloadgitlab-ce-ae33fdf297e03866ecc6c31c5470dd5ad72d1328.tar.gz
updated fork feature to use gitlab-shell for v5 of gitlab
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/backend/shell.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/gitlab/backend/shell.rb b/lib/gitlab/backend/shell.rb
index bae87977e8d..2c3ea902d93 100644
--- a/lib/gitlab/backend/shell.rb
+++ b/lib/gitlab/backend/shell.rb
@@ -36,6 +36,18 @@ module Gitlab
system("#{gitlab_shell_user_home}/gitlab-shell/bin/gitlab-projects mv-project #{path}.git #{new_path}.git")
end
+ # Fork repository to new namespace
+ #
+ # path - project path with namespace
+ # fork_namespace - namespace for forked project
+ #
+ # Ex.
+ # fork_repository("gitlab/gitlab-ci", "randx")
+ #
+ def fork_repository(path, fork_namespace)
+ system("#{gitlab_shell_user_home}/gitlab-shell/bin/gitlab-projects fork-project #{path}.git #{fork_namespace}")
+ end
+
# Remove repository from file system
#
# name - project path with namespace