icinga2/icingaweb2: Update get_snapshot to support branch/url changes

This commit is contained in:
Markus Frosch 2017-02-08 16:55:55 +01:00
parent 60ae45c7bf
commit 41df966396
1 changed files with 5 additions and 1 deletions

View File

@ -37,7 +37,11 @@ if [ -d "${PROJECT}.git/" ]; then
echo "This is not a GIT repository: $(pwd)" >&2
exit 1
fi
git fetch origin -p
if [ "$(git config remote.origin.url)" != "${UPSTREAM_GIT_URL}" ]; then
git remote set-url origin "${UPSTREAM_GIT_URL}"
fi
git fetch origin -p
git checkout -f "${UPSTREAM_GIT_BRANCH}"
git reset --hard "origin/${UPSTREAM_GIT_BRANCH}"
git clean -fdx
else