summaryrefslogtreecommitdiff
path: root/t/t0027-auto-crlf.sh
diff options
context:
space:
mode:
authorLibravatar Torsten Bögershausen <tboegi@web.de>2016-02-10 17:24:41 +0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-02-10 15:53:35 -0800
commitdf747b818f0c9b7d0db1d7e3837b78e5d48b6fde (patch)
tree2d78c9a5d7d3945c41df1877071b87d995f3ecf1 /t/t0027-auto-crlf.sh
parentconvert.c: use text_eol_is_crlf() (diff)
downloadtgif-df747b818f0c9b7d0db1d7e3837b78e5d48b6fde.tar.xz
convert.c: refactor crlf_action
Refactor the determination and usage of crlf_action. Today, when no "crlf" attribute are set on a file, crlf_action is set to CRLF_GUESS. Use CRLF_UNDEFINED instead, and search for "text" or "eol" as before. After searching for line ending attributes, save the value in struct conv_attrs.crlf_action attr_action, so that get_convert_attr_ascii() is able report the attributes. Replace the old CRLF_GUESS usage: CRLF_GUESS && core.autocrlf=true -> CRLF_AUTO_CRLF CRLF_GUESS && core.autocrlf=false -> CRLF_BINARY CRLF_GUESS && core.autocrlf=input -> CRLF_AUTO_INPUT Save the action in conv_attrs.crlf_action (as before) and change all callers. Make more clear, what is what, by defining: - CRLF_UNDEFINED : No attributes set. Temparally used, until core.autocrlf and core.eol is evaluated and one of CRLF_BINARY, CRLF_AUTO_INPUT or CRLF_AUTO_CRLF is selected - CRLF_BINARY : No processing of line endings. - CRLF_TEXT : attribute "text" is set, line endings are processed. - CRLF_TEXT_INPUT: attribute "input" or "eol=lf" is set. This implies text. - CRLF_TEXT_CRLF : attribute "eol=crlf" is set. This implies text. - CRLF_AUTO : attribute "auto" is set. - CRLF_AUTO_INPUT: core.autocrlf=input (no attributes) - CRLF_AUTO_CRLF : core.autocrlf=true (no attributes) Signed-off-by: Torsten Bögershausen <tboegi@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t0027-auto-crlf.sh')
0 files changed, 0 insertions, 0 deletions