summaryrefslogtreecommitdiff
path: root/git-merge-one-file.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-12-16 15:44:18 -0800
committerJunio C Hamano <gitster@pobox.com>2011-12-18 20:40:41 -0800
commit8496f568739626c86cb9d82e57fc0b55cb4c0849 (patch)
tree75604da441ec3291752363cb6a406e2b5b43ad57 /git-merge-one-file.sh
parent87afe9a5ed759668e35513c44eacd2fd393ba658 (diff)
downloadgit-8496f568739626c86cb9d82e57fc0b55cb4c0849.tar.gz
lf_to_crlf_filter(): resurrect CRLF->CRLF hackjc/maint-lf-to-crlf-keep-crlf
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 'git-merge-one-file.sh')
0 files changed, 0 insertions, 0 deletions