diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-02-17 12:46:21 -0600 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-02-17 12:54:41 -0600 |
commit | 4a8a28eb9e9dffb03a8c8be413aa341f452ce113 (patch) | |
tree | 174055c93969dfe6229d2df4efa2ca70fb868087 /app/controllers/concerns/creates_commit.rb | |
parent | a2801ec429a0ac02e622d61119439ff71150acf2 (diff) | |
download | gitlab-ce-4a8a28eb9e9dffb03a8c8be413aa341f452ce113.tar.gz |
Fix issue where files on a fork could not be edited
Diffstat (limited to 'app/controllers/concerns/creates_commit.rb')
-rw-r--r-- | app/controllers/concerns/creates_commit.rb | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/app/controllers/concerns/creates_commit.rb b/app/controllers/concerns/creates_commit.rb index 6286d67d30c..88d180fcc2e 100644 --- a/app/controllers/concerns/creates_commit.rb +++ b/app/controllers/concerns/creates_commit.rb @@ -104,23 +104,15 @@ module CreatesCommit if can?(current_user, :push_code, @project) # Edit file in this project @mr_source_project = @project - - if @project.forked? - # Merge request from this project to fork origin - @mr_target_project = @project.forked_from_project - @mr_target_branch = @mr_target_project.repository.root_ref - else - # Merge request to this project - @mr_target_project = @project - @mr_target_branch = @ref || @target_branch - end else # Merge request from fork to this project @mr_source_project = current_user.fork_of(@project) - @mr_target_project = @project - @mr_target_branch = @ref || @target_branch end + # Merge request to this project + @mr_target_project = @project + @mr_target_branch = @ref || @target_branch + @mr_source_branch = guess_mr_source_branch end |