From 909c1f2e5550ed5111d50683d184e5589ee62419 Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Wed, 8 Feb 2017 16:55:55 +0100 Subject: [PATCH] icinga2/icingaweb2: Update get_snapshot to support branch/url changes --- get_snapshot | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/get_snapshot b/get_snapshot index c956fe7..e82508f 100755 --- a/get_snapshot +++ b/get_snapshot @@ -37,7 +37,11 @@ if [ -d "${PROJECT}.git/" ]; then echo "This is not a GIT repository: $(pwd)" >&2 exit 1 fi + 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