summaryrefslogtreecommitdiff
path: root/app/controllers/projects_controller.rb
diff options
context:
space:
mode:
authorHan Loong Liauw <hanloongliauw@gmail.com>2015-10-13 21:24:44 +1100
committerHan Loong Liauw <hanloongliauw@gmail.com>2015-10-13 21:42:17 +1100
commitdf99ddbba13db4a7699bf1d585675f921cf382ce (patch)
treea6597628f5c46a553725a121169755f4c0f9cef2 /app/controllers/projects_controller.rb
parente12b6f30efef3f607cacc5da51f8c49c3be4643a (diff)
downloadgitlab-ce-df99ddbba13db4a7699bf1d585675f921cf382ce.tar.gz
Adds ability to remove the forked relationship
This was previously possible through the API but can now be done through the project#edit settings screen if the current user is the owner of the project. Update changelog
Diffstat (limited to 'app/controllers/projects_controller.rb')
-rw-r--r--app/controllers/projects_controller.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 213c2a7173b..1fb83d0eb6d 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -5,7 +5,7 @@ class ProjectsController < ApplicationController
before_action :repository, except: [:new, :create]
# Authorize
- before_action :authorize_admin_project!, only: [:edit, :update, :destroy, :transfer, :archive, :unarchive]
+ before_action :authorize_admin_project!, only: [:edit, :update, :destroy, :transfer, :archive, :unarchive, :remove_fork]
before_action :event_filter, only: [:show, :activity]
layout :determine_layout
@@ -64,6 +64,13 @@ class ProjectsController < ApplicationController
end
end
+ def remove_fork
+ if @project.forked?
+ @project.forked_project_link.destroy
+ flash[:notice] = 'Fork relationship has been removed.'
+ end
+ end
+
def activity
respond_to do |format|
format.html