git diff
doesn't support CR (^M) as a line ending. This is a Git limitation, and not something related to Bitbucket Server or Stash. This manifests in two ways:
Files which
only
contain CR line endings show as a single-line diff, but they are processed correctly
Files with
mixed
line endings (part of the file is LF, or CRLF, and part is CR) show unexpected results
and can fail processing entirely
When a mixed-ending file fails diffs, it can cause cascading failures in other parts of the system. The most important of these is comment drift, but it can also cause user-visible errors when attempting to view commit or pull request diffs.