diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-10-03 19:27:51 +0300 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-10-07 12:46:23 +0300 |
commit | 14a6cebc9feefc45b587bf9b9b706194b9b5bff9 (patch) | |
tree | ebcf667674746640cef75f5f54bee66212aac44a /app | |
parent | f90b27da7777b0c72782d2a930f770e2f27757e2 (diff) |
Store the name of a project that's a root of a fork network
So we can keep showing it to a user in his project page.
Diffstat (limited to 'app')
-rw-r--r-- | app/services/projects/destroy_service.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/services/projects/destroy_service.rb b/app/services/projects/destroy_service.rb index 54eb75ab9bf..19d75ff2efa 100644 --- a/app/services/projects/destroy_service.rb +++ b/app/services/projects/destroy_service.rb @@ -22,6 +22,13 @@ module Projects Projects::UnlinkForkService.new(project, current_user).execute + # The project is not necessarily a fork, so update the fork network originating + # from this project + if fork_network = project.root_of_fork_network + fork_network.update(root_project: nil, + deleted_root_project_name: project.full_name) + end + attempt_destroy_transaction(project) system_hook_service.execute_hooks_for(project, :destroy) |