From 63d7cf0ad4a52deb5f79c1db50727e792a4b224d Mon Sep 17 00:00:00 2001 From: minottic Date: Wed, 13 Nov 2024 16:06:04 +0100 Subject: [PATCH] Avoid stashing and checking out if volume is set This is to avoid unpredictable behaviours --- README.md | 2 +- entrypoints/setup_git.sh | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 8af6a51c..61a7ec7a 100644 --- a/README.md +++ b/README.md @@ -186,7 +186,7 @@ e.g., for the frontend: + GITHUB_REPO: https://github.com/SciCatProject/frontend.git#v4.4.1 ``` -If you did not remove the volume, specified a new branch, and had any uncommited changes, they will be stashed to checkout to the selected branch. You can later reapply them by `git stash apply`. +The repo is checkout at that particular commit only if the docker volume does not yet exist. diff --git a/entrypoints/setup_git.sh b/entrypoints/setup_git.sh index e33d82a1..f5d4985c 100755 --- a/entrypoints/setup_git.sh +++ b/entrypoints/setup_git.sh @@ -17,9 +17,8 @@ then DEFAULT_BRANCH=$(git remote show origin | sed -n '/HEAD branch/s/.*: //p') git reset --hard origin/"${DEFAULT_BRANCH}" git clean -fd -fi -if [ -n "${TAG}" ] && [ "${TAG}" != "$(git describe --tags)" ] -then - git stash - git checkout "${TAG}" + if [ -n "${TAG}" ] + then + git checkout "${TAG}" + fi fi