From 4c04dbe9e7a1a886f574bf1bf97bf214ad6d552c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radek=20Barto=C5=88?= Date: Thu, 10 Oct 2024 10:46:28 +0200 Subject: [PATCH] Fix switch to another git branch (#202) --- .github/scripts/update-sources.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/scripts/update-sources.sh b/.github/scripts/update-sources.sh index 346dde0aa..851a958ee 100755 --- a/.github/scripts/update-sources.sh +++ b/.github/scripts/update-sources.sh @@ -17,6 +17,10 @@ function update_repository() { pushd $DIRECTORY if [[ "$RESET_SOURCES" = 1 ]]; then git reset --hard HEAD + if ! git show-ref --verify --quiet refs/remotes/origin/$BRANCH; then + git remote set-branches --add origin $BRANCH + git fetch origin --prune + fi git switch $BRANCH git clean -fdx fi