mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-03 18:47:03 +00:00
Merge pull request #4562 from ManaSugi/git-safe-repo
Set safe.directory against tests repository
This commit is contained in:
commit
c29038a2e2
@ -18,6 +18,13 @@ clone_tests_repo()
|
|||||||
{
|
{
|
||||||
if [ -d "$tests_repo_dir" ]; then
|
if [ -d "$tests_repo_dir" ]; then
|
||||||
[ -n "${CI:-}" ] && return
|
[ -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}"
|
pushd "${tests_repo_dir}"
|
||||||
git checkout "${branch}"
|
git checkout "${branch}"
|
||||||
git pull
|
git pull
|
||||||
|
Loading…
Reference in New Issue
Block a user