WebIDE removes UTF8 BOM, does not show change in diff review
Initial issue
#22155 (closed) auto-closed
Summary
The WebIDE silently removes the UTF8 BOM from a file when commiting. In diff review, the additional change removing the BOM is not shown, but is then commited when pressing the commit button
Steps to reproduce
see also https://gitlab.com/arwarw/BOM-bug-demo containing these steps:
- Edit some-file containing a BOM using the WebIDE
- Make some change to the file unrelated to and not touching the BOM
- Review the diff for the change made. See attached screenshot 1
- Click "Commit" button
- An error appears, see screenshot 2 (This error happened on gitlab.com. The error did not appear on our local GitLab CE instance when first observing the bug. I do not know if it is relevant or not.)
- However, the change seems to have been committed. Upon inspection of the commit, observe that the BOM at the start of the file is now missing.
Example Project
See https://gitlab.com/arwarw/BOM-bug-demo containing these aforementioned steps.
What is the current bug behavior?
WebIDE removes the BOM from the file.
WebIDE does not show this removal on review.
What is the expected correct behavior?
BOM should be left intact.
Alternatively, removal of the BOM should at least be indicated in the review diff before commiting.
Edited by Patricia Dulhaz