summaryrefslogtreecommitdiff
path: root/quote.h
diff options
context:
space:
mode:
authorLibravatar Torsten Bögershausen <tboegi@web.de>2017-11-26 13:20:52 +0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-11-27 10:17:24 +0900
commit86ff70a0f0d3917205e1aa82dba08db92d357cc0 (patch)
tree3eab13624f6909418328dbc8c12f5275eb436912 /quote.h
parentGit 2.14.3 (diff)
downloadtgif-86ff70a0f0d3917205e1aa82dba08db92d357cc0.tar.xz
convert: tighten the safe autocrlf handling
When a text file had been commited with CRLF and the file is commited again, the CRLF are kept if .gitattributs has "text=auto". This is done by analyzing the content of the blob stored in the index: If a '\r' is found, Git assumes that the blob was commited with CRLF. The simple search for a '\r' does not always work as expected: A file is encoded in UTF-16 with CRLF and commited. Git treats it as binary. Now the content is converted into UTF-8. At the next commit Git treats the file as text, the CRLF should be converted into LF, but isn't. Replace has_cr_in_index() with has_crlf_in_index(). When no '\r' is found, 0 is returned directly, this is the most common case. If a '\r' is found, the content is analyzed more deeply. Reported-By: Ashish Negi <ashishnegi33@gmail.com> Signed-off-by: Torsten Bögershausen <tboegi@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'quote.h')
0 files changed, 0 insertions, 0 deletions