diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-05-02 23:41:07 -0700 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-05-02 23:41:07 -0700 |
commit | f40d4e6685ca749c69bfc480a747a430f6c9825f (patch) | |
tree | 0cfdb3e6276c6b4cce664b89c4da37f55adaac55 /app/controllers/projects_controller.rb | |
parent | 36efe0f5807e92c2a0b6ec71b828387e6684a9ab (diff) | |
parent | ec63804831d1a55171abfb7fc0894af20d4298e8 (diff) | |
download | gitlab-ce-f40d4e6685ca749c69bfc480a747a430f6c9825f.tar.gz |
Merge pull request #3597 from amacarthur/fork-pull-request
updated fork feature to use gitlab-shell for v5 of gitlab
Diffstat (limited to 'app/controllers/projects_controller.rb')
-rw-r--r-- | app/controllers/projects_controller.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 8e55aa01cc9..255baba0ecb 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -78,4 +78,19 @@ class ProjectsController < ProjectResourceController format.html { redirect_to root_path } end end + + def fork + @project = ::Projects::ForkContext.new(project, current_user).execute + + respond_to do |format| + format.html do + if @project.saved? && @project.forked? + redirect_to(@project, notice: 'Project was successfully forked.') + else + render action: "new" + end + end + format.js + end + end end |