Error message when creating a commit in a forked project
Summary
When trying to create a commit in a forked project a user gets an error that a branch already exists.
Steps to reproduce
- Go to a forked project
- Go to file edit and make a change
- Click "Commit changes"
- You will get an error: "Branch with such name already exists. You need to switch to this branch in order to make changes" (while you are on that branch as can be seen in the attached screenshot)
What is the current bug behavior?
A user gets an error when trying to commit a change.
What is the expected correct behavior?
A change is committed to the forked project (the actual project a user is in) and desired branch.
Relevant logs and/or screenshots
Output of checks
This happens on gitlab.com
Possible fixes
The problematic parts are https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/services/files/base_service.rb#L68 where the error is raised and https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/controllers/concerns/creates_commit.rb#L108 where an original project is set instead of forked project.