Skip to main content

should_normalise

Function should_normalise 

Source
pub fn should_normalise(mode: TextMode, content: &[u8]) -> bool
Expand description

Whether the content should be normalised, given its declared mode.

Unlike git, the answer never depends on the index. Git keeps CRLF for a file that entered the repository with it, even after core.autocrlf is switched on — which makes its verdict a function of history, not content. Ours has to be a pure function of content or the same file encrypts differently depending on where it has been.