diff options
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 |