Merge pull request #9747 from zvonkok/remove-git-config

ci: Remove all git config safe.directory
This commit is contained in:
Zvonko Kaiser 2024-05-31 07:25:28 +02:00 committed by GitHub
commit dd89d35b75
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 1 additions and 12 deletions

View File

@ -21,13 +21,7 @@ clone_tests_repo()
{
if [ -d "$tests_repo_dir" ]; then
[ -n "${CI:-}" ] && return
# git config --global --add safe.directory will always append
# the target to .gitconfig without checking the existence of
# the target, so it's better to check it before adding the target repo.
local sd="$(git config --global --get safe.directory ${tests_repo_dir} || true)"
if [ -z "${sd}" ]; then
git config --global --add safe.directory ${tests_repo_dir}
fi
pushd "${tests_repo_dir}"
git checkout "${branch}"
git pull

View File

@ -1211,8 +1211,6 @@ silent_mode_error_trap() {
}
main() {
git config --global --add safe.directory ${repo_root_dir}
local build_targets
local silent
build_targets=(

View File

@ -107,8 +107,6 @@ get_last_modification() {
local file="${1}"
pushd ${repo_root_dir} &> /dev/null
# This is a workaround needed for when running this code on Jenkins
git config --global --add safe.directory ${repo_root_dir} &> /dev/null
dirty=""
[ $(git status --porcelain | grep "${file#${repo_root_dir}/}" | wc -l) -gt 0 ] && dirty="-dirty"

View File

@ -59,7 +59,6 @@ build_clh_from_source() {
repo_dir="${repo_dir//.git}"
rm -rf "${repo_dir}"
git clone "${cloud_hypervisor_repo}"
git config --global --add safe.directory "$PWD/repo_dir"
pushd "${repo_dir}"
if [ -n "${cloud_hypervisor_pr}" ]; then