mirror of
https://github.com/dani-garcia/bw_web_builds.git
synced 2024-12-26 04:18:15 +03:00
Merge pull request #148 from kpfleming/upstream_branch_name_change
Upstream repository default branch is now called 'main'.
This commit is contained in:
commit
09c7f41979
1 changed files with 5 additions and 5 deletions
|
@ -15,7 +15,7 @@ trap 'handle_error $LINENO $?' ERR
|
||||||
|
|
||||||
# Ask for ref if not provided
|
# Ask for ref if not provided
|
||||||
if [[ -z "$VAULT_VERSION" ]]; then
|
if [[ -z "$VAULT_VERSION" ]]; then
|
||||||
read -rp "Input a git ref (commit hash, branch name, tag name, 'master'): " input
|
read -rp "Input a git ref (commit hash, branch name, tag name, 'main'): " input
|
||||||
VAULT_VERSION="${input}"
|
VAULT_VERSION="${input}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -34,10 +34,10 @@ if [ ! -d "${VAULT_FOLDER}" ]; then
|
||||||
else
|
else
|
||||||
# If there already is a checked-out repo, lets clean it up first.
|
# If there already is a checked-out repo, lets clean it up first.
|
||||||
pushd "${VAULT_FOLDER}"
|
pushd "${VAULT_FOLDER}"
|
||||||
# Stash current changes if there are any, we don't want to loose our work if we had some
|
# Stash current changes if there are any, we don't want to lose our work if we had some
|
||||||
git stash --include-untracked --quiet &> /dev/null || true
|
git stash --include-untracked --quiet &> /dev/null || true
|
||||||
# Checkout the master repo first
|
# Checkout the main branch first
|
||||||
git checkout master
|
git checkout main
|
||||||
git reset --hard
|
git reset --hard
|
||||||
git checkout -f
|
git checkout -f
|
||||||
popd
|
popd
|
||||||
|
@ -47,7 +47,7 @@ pushd "${VAULT_FOLDER}"
|
||||||
|
|
||||||
# Update branch and tag metadata
|
# Update branch and tag metadata
|
||||||
git fetch --tags --all
|
git fetch --tags --all
|
||||||
git pull origin master
|
git pull origin main
|
||||||
|
|
||||||
# Checkout the branch we want
|
# Checkout the branch we want
|
||||||
git -c advice.detachedHead=false checkout "${VAULT_VERSION}"
|
git -c advice.detachedHead=false checkout "${VAULT_VERSION}"
|
||||||
|
|
Loading…
Reference in a new issue