Creating new merge request with deletes and changes results in data loss
Summary
If you start a new branch in the web IDE and have it create a branch for you, you can end up in a situation where some of your changes are lost because they were not included in the initial commit.
Steps to reproduce
- Open web IDE on a project
- Delete a file
- Modify a file
- Commit and request that a new branch be created and an MR opened
- Fill out MR details
- See that modification is lost, only delete is retained
Example Project
The initial commit for gitlab-com/www-gitlab-com!29560 (merged) contained modifications and deletes, but all the modifications were lost.
What is the current bug behavior?
Only deletes are retained
What is the expected correct behavior?
All changes are retained
Relevant logs and/or screenshots
(Paste any relevant logs - please use code blocks (```) to format console output, logs, and code as it's tough to read otherwise.)
Output of checks
(If you are reporting a bug on GitLab.com, write: This bug happens on GitLab.com)
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:env:info
)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production
)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true
)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true
)(we will only investigate if the tests are passing)
Possible fixes
(If you can, link to the line of code that might be responsible for the problem)