Define 'crlf' attribute.

This defines the semantics of 'crlf' attribute as an example.
When a path has this attribute unset (i.e. '!crlf'), autocrlf
line-end conversion is not applied.

Eventually we would want to let users to build a pipeline of
processing to munge blob data to filesystem format (and in the
other direction) based on combination of attributes, and at that
point the mechanism in convert_to_{git,working_tree}() that
looks at 'crlf' attribute needs to be enhanced.  Perhaps the
existing 'crlf' would become the first step in the input chain,
and the last step in the output chain.

Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Junio C Hamano
2007-04-12 22:30:05 -07:00
parent d0bfd026a8
commit 35ebfd6a0c
3 changed files with 84 additions and 7 deletions

View File

@ -214,4 +214,28 @@ test_expect_success 'apply patch --index (autocrlf=true)' '
}
'
test_expect_success '.gitattributes says two is binary' '
echo "two !crlf" >.gitattributes &&
rm -f tmp one dir/two &&
git repo-config core.autocrlf true &&
git read-tree --reset -u HEAD &&
if remove_cr dir/two >/dev/null
then
echo "Huh?"
false
else
: happy
fi &&
if remove_cr one >/dev/null
then
: happy
else
echo "Huh?"
false
fi
'
test_done