Ports: Ensure that core.autocrlf is disabled before handling patches

While `core.autocrlf=false` should be the default, there will certainly
be users that have changed the default setting in their global
configuration.

Ensure that the setting is disabled to avoid accidentally mangling or
not applying our patches.
This commit is contained in:
Tim Schumacher 2022-06-16 18:56:08 +02:00 committed by Linus Groh
commit e29e4e6c1f
Notes: sideshowbarker 2024-07-17 10:08:21 +09:00

View file

@ -727,6 +727,7 @@ do_dev() {
pushd "$git_repo" pushd "$git_repo"
if [ ! -d "$git_repo/.git" ]; then if [ ! -d "$git_repo/.git" ]; then
git init . git init .
git config core.autocrlf false
git add --all --force git add --all --force
git commit -a -m 'Initial import' git commit -a -m 'Initial import'
fi fi
@ -809,14 +810,14 @@ do_dev() {
) )
[ -d "$git_repo" ] && [ ! -d "$workdir" ] && { [ -d "$git_repo" ] && [ ! -d "$workdir" ] && {
git clone "$git_repo" "$workdir" git clone --config core.autocrlf=false "$git_repo" "$workdir"
} }
[ -d "$workdir/.git" ] || { [ -d "$workdir/.git" ] || {
>&2 echo "$workdir does not appear to be a git repository, if you did this manually, you're on your own" >&2 echo "$workdir does not appear to be a git repository, if you did this manually, you're on your own"
if prompt_yes_no "Otherwise, press 'y' to remove that directory and clone it again"; then if prompt_yes_no "Otherwise, press 'y' to remove that directory and clone it again"; then
rm -fr "$workdir" rm -fr "$workdir"
git clone "$git_repo" "$workdir" git clone --config core.autocrlf=false "$git_repo" "$workdir"
else else
exit 1 exit 1
fi fi