diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-04-09 13:41:37 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-04-09 13:41:37 +0000 |
commit | 1ff40a79462dcb0d8e717b51ad3048b1da817651 (patch) | |
tree | 535e21a2bdfae54a43bf15e65f4dd99390e30833 /app/services | |
parent | f3f856029bc5f966c5a7ee24cf7efefdd20e6019 (diff) | |
parent | e28bc41f762a4bf00d20f5fd61bb30542ee74c10 (diff) | |
download | gitlab-ce-1ff40a79462dcb0d8e717b51ad3048b1da817651.tar.gz |
Merge branch 'ci_fork' into 'master'
Project fork on CI side
https://dev.gitlab.org/gitlab/gitlab-ci/issues/187
!!! GitLab CI side MR - https://gitlab.com/gitlab-org/gitlab-ci/merge_requests/56
See merge request !499
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/projects/fork_service.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/services/projects/fork_service.rb b/app/services/projects/fork_service.rb index 6b0d4aca3e1..4ec98696a65 100644 --- a/app/services/projects/fork_service.rb +++ b/app/services/projects/fork_service.rb @@ -40,12 +40,18 @@ module Projects if project.save project.team << [@current_user, :master] end + #Now fork the repo unless gitlab_shell.fork_repository(@from_project.path_with_namespace, project.namespace.path) raise 'forking failed in gitlab-shell' end + project.ensure_satellite_exists end + + if @from_project.gitlab_ci? + ForkRegistrationWorker.perform_async(@from_project.id, project.id, @current_user.private_token) + end rescue => ex project.errors.add(:base, 'Fork transaction failed.') project.destroy |