]>
git.proxmox.com Git - libgit2.git/blob - tests/generate_crlf.sh
d3fd1bb9a56e011c456439d5c355f11b8b18b298
5 if [ "$1" == "" -o "$2" == "" ]; then
6 echo "usage: $0 crlfrepo directory [tempdir]"
24 local worktree
="${output}/${systype}/autocrlf_${autocrlf}"
26 if [ "$attr" != "" ]; then
27 local attrdir
=`echo $attr | sed -e "s/ /,/g" | sed -e "s/=/_/g"`
28 worktree
="${worktree},${attrdir}"
31 if [ "$tempdir" = "" ]; then
32 local gitdir
="${worktree}/.git"
34 local gitdir
="${tempdir}/generate_crlf_${RANDOM}"
37 echo "Creating ${worktree}"
38 mkdir
-p "${worktree}"
40 git clone
--no-checkout --quiet --bare "${input}/.gitted" "${gitdir}"
41 git
--work-tree="${worktree}" --git-dir="${gitdir}" config core.autocrlf ${autocrlf}
43 if [ "$attr" != "" ]; then
44 echo "* ${attr}" >> "${worktree}/.gitattributes
"
47 git --work-tree="${worktree}" --git-dir="${gitdir}" checkout HEAD
49 if [ "$attr" != "" ]; then
50 rm "${worktree}/.gitattributes
"
53 if [ "$tempdir" != "" ]; then
58 if [[ `uname -s` == MINGW* ]]; then
64 for autocrlf in true false input; do
65 for attr in "" text text=auto -text crlf -crlf eol=lf eol=crlf \
66 "text eol
=lf
" "text eol
=crlf
" \
67 "text
=auto eol
=lf
" "text
=auto eol
=crlf
"; do
69 create_repo "${input}" "${output}" "${tempdir}" \
70 "${systype}" "${autocrlf}" "${attr}"