Skip to content

Commit

Permalink
Avoid stashing and checking out if volume is set
Browse files Browse the repository at this point in the history
This is to avoid unpredictable behaviours
  • Loading branch information
minottic committed Nov 13, 2024
1 parent bf828af commit 63d7cf0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
</details>
Expand Down
9 changes: 4 additions & 5 deletions entrypoints/setup_git.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 63d7cf0

Please sign in to comment.