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
parent c9a70ffff5
commit e29e4e6c1f

View file

@ -727,6 +727,7 @@ do_dev() {
pushd "$git_repo"
if [ ! -d "$git_repo/.git" ]; then
git init .
git config core.autocrlf false
git add --all --force
git commit -a -m 'Initial import'
fi
@ -809,14 +810,14 @@ do_dev() {
)
[ -d "$git_repo" ] && [ ! -d "$workdir" ] && {
git clone "$git_repo" "$workdir"
git clone --config core.autocrlf=false "$git_repo" "$workdir"
}
[ -d "$workdir/.git" ] || {
>&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
rm -fr "$workdir"
git clone "$git_repo" "$workdir"
git clone --config core.autocrlf=false "$git_repo" "$workdir"
else
exit 1
fi