Skip to content

Commit c22da52

Browse files
authored
Adding workspace var for git safe dir when it is missing (#137893)
1 parent e890ad7 commit c22da52

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

.ci/scripts/packaging-test.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,15 @@ sudo bash -c 'cat > /etc/sudoers.d/elasticsearch_vars' << SUDOERS_VARS
6161
SUDOERS_VARS
6262
sudo chmod 0440 /etc/sudoers.d/elasticsearch_vars
6363

64-
# Bats tests still use this locationa
64+
# Bats tests still use this location
6565
sudo rm -Rf /elasticsearch
6666
sudo mkdir -p /elasticsearch/qa/ && sudo chown jenkins /elasticsearch/qa/ && ln -s $PWD/qa/vagrant /elasticsearch/qa/
6767

68+
#
69+
if [[ -z "${WORKSPACE}" ]]; then
70+
WORKSPACE=$(pwd)
71+
fi
72+
6873
# Ensure since we're running as root that we can do git operations in this directory
6974
# See: https://git-scm.com/docs/git-config/2.35.2#Documentation/git-config.txt-safedirectory
7075
git config --global --add safe.directory $WORKSPACE

0 commit comments

Comments
 (0)