summaryrefslogtreecommitdiff
path: root/lib/gitlab
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2017-12-04 11:31:15 +0000
committerDouwe Maan <douwe@gitlab.com>2017-12-04 11:31:15 +0000
commit50eb125282ba83e71447161ee2add396fa5eef9b (patch)
tree55352ccc9470cf397ffe6efdc85db3f5432e6068 /lib/gitlab
parentae1c0c4e759abdb534bf2b029769f698667ae2a6 (diff)
parent327a9898a226a098b18e80e4950702064ecd38f1 (diff)
downloadgitlab-ce-50eb125282ba83e71447161ee2add396fa5eef9b.tar.gz
Merge branch '40711-fix-forking-hashed-projects' into 'master'
Fix the fork project functionality for projects with hashed storage Closes #40711 See merge request gitlab-org/gitlab-ce!15671
Diffstat (limited to 'lib/gitlab')
-rw-r--r--lib/gitlab/shell.rb23
1 files changed, 15 insertions, 8 deletions
diff --git a/lib/gitlab/shell.rb b/lib/gitlab/shell.rb
index 996d213fdb4..a22a63665be 100644
--- a/lib/gitlab/shell.rb
+++ b/lib/gitlab/shell.rb
@@ -143,20 +143,27 @@ module Gitlab
storage, "#{path}.git", "#{new_path}.git"])
end
- # Fork repository to new namespace
+ # Fork repository to new path
# forked_from_storage - forked-from project's storage path
- # path - project path with namespace
+ # forked_from_disk_path - project disk path
# forked_to_storage - forked-to project's storage path
- # fork_namespace - namespace for forked project
+ # forked_to_disk_path - forked project disk path
#
# Ex.
- # fork_repository("/path/to/forked_from/storage", "gitlab/gitlab-ci", "/path/to/forked_to/storage", "randx")
+ # fork_repository("/path/to/forked_from/storage", "gitlab/gitlab-ci", "/path/to/forked_to/storage", "new-namespace/gitlab-ci")
#
# Gitaly note: JV: not easy to migrate because this involves two Gitaly servers, not one.
- def fork_repository(forked_from_storage, path, forked_to_storage, fork_namespace)
- gitlab_shell_fast_execute([gitlab_shell_projects_path, 'fork-project',
- forked_from_storage, "#{path}.git", forked_to_storage,
- fork_namespace])
+ def fork_repository(forked_from_storage, forked_from_disk_path, forked_to_storage, forked_to_disk_path)
+ gitlab_shell_fast_execute(
+ [
+ gitlab_shell_projects_path,
+ 'fork-repository',
+ forked_from_storage,
+ "#{forked_from_disk_path}.git",
+ forked_to_storage,
+ "#{forked_to_disk_path}.git"
+ ]
+ )
end
# Remove repository from file system