diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-12-16 15:44:18 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-12-18 20:40:41 -0800 |
commit | 8496f568739626c86cb9d82e57fc0b55cb4c0849 (patch) | |
tree | 75604da441ec3291752363cb6a406e2b5b43ad57 /compat/nedmalloc | |
parent | lf_to_crlf_filter(): tell the caller we added "\n" when draining (diff) | |
download | tgif-8496f568739626c86cb9d82e57fc0b55cb4c0849.tar.xz |
lf_to_crlf_filter(): resurrect CRLF->CRLF hack
The non-streaming version of the filter counts CRLF and LF in the whole
buffer, and returns without doing anything when they match (i.e. what is
recorded in the object store already uses CRLF). This was done to help
people who added files from the DOS world before realizing they want to go
cross platform and adding .gitattributes to tell Git that they only want
CRLF in their working tree.
The streaming version of the filter does not want to read the whole thing
before starting to work, as that defeats the whole point of streaming. So
we instead check what byte follows CR whenever we see one, and add CR
before LF only when the LF does not immediately follow CR already to keep
CRLF as is.
Reported-and-tested-by: Ralf Thielow
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'compat/nedmalloc')
0 files changed, 0 insertions, 0 deletions