Revert "Feature: Create a new branch, if the given branch name doesn't exist yet"

This commit is contained in:
Stefan Zweifel
2021-02-23 21:14:19 +01:00
committed by GitHub
parent 3870982ac5
commit 75625df4f3
2 changed files with 3 additions and 44 deletions

View File

@@ -48,28 +48,9 @@ _switch_to_branch() {
git fetch --depth=1;
fi
# If INPUT_BRANCH is empty, just run `git checkout`
if [ -z "$INPUT_BRANCH" ]
then
# shellcheck disable=SC2086
git checkout $INPUT_BRANCH;
else
# If the branch which we should checkout already exists, just
# run `git checkout $INPUT_BRANCH`
# Otherwhise create a new branch by adding the `-b` option to
# `git-checkout`
# shellcheck disable=SC2086
if [ -n "$(git branch --list $INPUT_BRANCH)" ]
then
# shellcheck disable=SC2086
git checkout $INPUT_BRANCH;
else
# shellcheck disable=SC2086
git checkout -b $INPUT_BRANCH;
fi
fi
# Switch to branch from current Workflow run
# shellcheck disable=SC2086
git checkout $INPUT_BRANCH;
}
_add_files() {