mirror of
https://github.com/stefanzweifel/git-auto-commit-action.git
synced 2024-11-06 02:08:05 +00:00
Cleanup Code
This commit is contained in:
parent
7507738fca
commit
94941cff88
@ -49,37 +49,24 @@ _switch_to_branch() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# If INPUT_BRANCH is empty, just run `git checkout`
|
# If INPUT_BRANCH is empty, just run `git checkout`
|
||||||
if [ -z "$INPUT_BRANCH" ]
|
if [ -z "$INPUT_BRANCH" ]
|
||||||
then
|
then
|
||||||
|
|
||||||
# Switch to branch from current Workflow run
|
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
git checkout $INPUT_BRANCH;
|
git checkout $INPUT_BRANCH;
|
||||||
|
|
||||||
else
|
else
|
||||||
|
# If the branch which we should checkout already exists, just
|
||||||
# If INPUT_BRANCH is given, check if a branch already exists
|
# run `git checkout $INPUT_BRANCH`
|
||||||
# If not create one
|
# Otherwhise create a new branch by adding the `-b` option to
|
||||||
|
# `git-checkout`
|
||||||
|
|
||||||
if [ -n "$(git branch --list $INPUT_BRANCH)" ]
|
if [ -n "$(git branch --list $INPUT_BRANCH)" ]
|
||||||
then
|
then
|
||||||
|
|
||||||
# Switch to branch from current Workflow run
|
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
git checkout $INPUT_BRANCH;
|
git checkout $INPUT_BRANCH;
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
# Switch to branch from current Workflow run
|
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
git checkout -b $INPUT_BRANCH;
|
git checkout -b $INPUT_BRANCH;
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user