ceph-csi/deploy/checkout-repo.sh
Niels de Vos b0e9eeba36 ci: correct parameter passing in checkout-repo.sh
ShellCheck failed with the following warning:

```
SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
git config --global --add safe.directory "${PWD}"
```

Signed-off-by: Niels de Vos <ndevos@ibm.com>
2023-03-20 09:21:41 +00:00

19 lines
385 B
Bash
Executable File

#!/bin/sh
fail() {
echo "${@}" > /dev/stderr
exit 1
}
[ -n "${GIT_REPO}" ] || fail 'GIT_REPO environment variable not set'
[ -n "${GIT_REF}" ] || fail 'GIT_REF environment variable not set'
# exit in case a command fails
set -e
git config --global --add safe.directory "${PWD}"
git init .
git remote add origin "${GIT_REPO}"
git fetch origin "${GIT_REF}"
git checkout FETCH_HEAD