Don't show move flags when changing whitespace on a line.
Review Request #5567 — Created March 1, 2014 and submitted — Latest diff uploaded
Whitespace-only changes on a line would result in a replace chunk that
could trigger move detection. This happened because we strip lines
before calculating moved lines, and didn't check that the same line was
modified, resulting in the line matching itself.We now compare the offsets into the chunk to make sure that matched
lines aren't in the same location within the chunk. By this point, we
already know the content is matched after being stripped, so an offset
change should be sufficient to prevent this problem from occurring.
Tested with a diff that exhibited the behavior. It went away after this.
Existing diffs with valid move flags for replace lines continued to work.
All existing unit tests passed.
A new unit test was added to test leading and trailing whitespace changes,
adding and removing.