diff options
author | Robert Speicher <robert@gitlab.com> | 2017-02-20 23:05:51 +0300 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2017-02-20 23:05:51 +0300 |
commit | 608711c247c1d58bd8f38e459ea9897b76802dc3 (patch) | |
tree | cd627cb5d9cbdba96e22da53ba6d90a92e48c7ee /app/controllers | |
parent | 91ac1991b5810b4f2378b5821e02bbeb4d379140 (diff) | |
parent | cd0f688707c4330207626bb47b1bf4e0df0e988e (diff) |
Merge branch 'dm-fix-editing-files-on-forks-quick' into 'master'
Fix issue where files on a fork could not be edited
Closes #28188
See merge request !9349
Diffstat (limited to 'app/controllers')
-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 |