From 5c60b0c2afa1b3865f795aeea3c2c44fb03de4a6 Mon Sep 17 00:00:00 2001 From: Alexey-Ayupov <116575425+Alexey-Ayupov@users.noreply.github.com> Date: Mon, 20 May 2024 23:37:11 +0200 Subject: [PATCH] [macOS] Add new git environment variable (#9900) --- images/macos/scripts/build/configure-machine.sh | 3 +++ images/macos/scripts/tests/Git.Tests.ps1 | 3 +++ 2 files changed, 6 insertions(+) diff --git a/images/macos/scripts/build/configure-machine.sh b/images/macos/scripts/build/configure-machine.sh index 294935000..402aea10b 100644 --- a/images/macos/scripts/build/configure-machine.sh +++ b/images/macos/scripts/build/configure-machine.sh @@ -103,3 +103,6 @@ if [[ ! -d "/usr/local/bin" ]];then fi chmod +x $HOME/utils/invoke-tests.sh sudo ln -s $HOME/utils/invoke-tests.sh /usr/local/bin/invoke_tests + +# Revert to the old behaviour and avoid the Git LFS problems (https://github.blog/2024-05-14-securing-git-addressing-5-new-vulnerabilities/) +echo "export GIT_CLONE_PROTECTION_ACTIVE=false" >> $HOME/.bashrc diff --git a/images/macos/scripts/tests/Git.Tests.ps1 b/images/macos/scripts/tests/Git.Tests.ps1 index f216baa0b..3efb6d82c 100644 --- a/images/macos/scripts/tests/Git.Tests.ps1 +++ b/images/macos/scripts/tests/Git.Tests.ps1 @@ -9,4 +9,7 @@ Describe "Git" { It "git lfs is installed" -Skip:($os.IsBigSur) { "git lfs version" | Should -ReturnZeroExitCode } + It "GIT_CLONE_PROTECTION_ACTIVE environment variable should be equal false" { + $env:GIT_CLONE_PROTECTION_ACTIVE | Should -BeExactly false + } }