Skip to content

Hide whitespace changes doesn't hide all whitespace changes

Summary

When clicking the button Hide whitespace changes on the changes tab of a (specific) merge request, not all whitespace changes are hidden.

Steps to reproduce

  1. Add and commit this a file called TESTFILE with the following contents into a repository:
    Leading whitespace with tab 1
    Leading whitespace with space 2
    Trailing whitespace with tab 3
    Trailing whitespace with space 4
  2. Make a new branch. Eg. whitespace-test
  3. Replace TESTFILE with the following contents (Note the leading/trailing whitespace changes as well):
            Leading whitespace with tab 1
     Leading whitespace with space 2
    Trailing whitespace with tab 3	
    Trailing whitespace with space 4 
  4. Create a new MR from this branch.
  5. Look at the diff with Show Whitespace changes both on and off, observe that whitespace changes with leading whitespace are always displayed.

Expected behavior

No whitespace changes are displayed.

Actual behavior

Some whitespace changes are still displayed.

Screenshot

screenshots

Show whitespace changes enabled: show_whitespace_changes_enabled

Show whitespace changes disabled: show_whitespace_changes_disabled

Edited by Pedro Moreira da Silva