From 10c3af4645e0a6a13b1d2f34d934c2df0f6ea25e Mon Sep 17 00:00:00 2001 From: Kaspars Dambis Date: Thu, 7 Dec 2023 10:26:46 +0200 Subject: [PATCH 1/2] Ensure it doesn't reset to current head after checkout if branch exists --- local/scripts/deploy.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/local/scripts/deploy.sh b/local/scripts/deploy.sh index e0345b4a..c7a1b17f 100755 --- a/local/scripts/deploy.sh +++ b/local/scripts/deploy.sh @@ -56,7 +56,9 @@ export GIT_WORK_TREE="$UPSTREAM_DIR" rm -rf "$UPSTREAM_DIR" git clone "$UPSTREAM_REPO" "$UPSTREAM_DIR/.git" -git checkout -B "$UPSTREAM_BRANCH" + +# Checkout the release branch or create it if it doesn't exist. +git checkout "$UPSTREAM_BRANCH" || git checkout -B "$UPSTREAM_BRANCH" # Ensure we remove everything before copying over the contents # such as submodule references, etc. From 7b465b2dbe4826cc746f430902e1990b68f7edc7 Mon Sep 17 00:00:00 2001 From: Kaspars Dambis Date: Tue, 6 Feb 2024 09:51:37 +0200 Subject: [PATCH 2/2] Make it generic --- local/scripts/deploy.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/local/scripts/deploy.sh b/local/scripts/deploy.sh index c7a1b17f..cb34609c 100755 --- a/local/scripts/deploy.sh +++ b/local/scripts/deploy.sh @@ -46,8 +46,8 @@ LAST_COMMIT_MSG=$(git log -1 --pretty=%B) npm install --ignore-scripts npm run release -# Clone the upstream repository. -echo "Fetching the latest changes from the VIP Go upstream repository:" +# Clone the release repository. +echo "Fetching the latest changes from the VIP release repository:" export GIT_DIR="$UPSTREAM_DIR/.git" export GIT_WORK_TREE="$UPSTREAM_DIR" @@ -64,7 +64,7 @@ git checkout "$UPSTREAM_BRANCH" || git checkout -B "$UPSTREAM_BRANCH" # such as submodule references, etc. git rm -r --quiet . -echo "Copying files to the VIP Go upstream repository:" +echo "Copying files to the VIP release repository:" # Sync everything from our clean git directory to our git upstream directory. rsync --archive --recursive --filter='protect .git' --delete --prune-empty-dirs \