mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-30 02:00:19 +00:00
b0e9eeba36
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>
19 lines
385 B
Bash
Executable File
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
|