mirror of
https://github.com/cpina/github-action-push-to-another-repository.git
synced 2024-12-22 08:06:10 -07:00
Change indentation, add comment, use "git switch -c" instead of "git checkout -b"
This commit is contained in:
parent
33585ea95a
commit
cbe757f8d8
|
@ -72,7 +72,10 @@ git config --global user.name "$USER_NAME"
|
||||||
{
|
{
|
||||||
git clone --single-branch --depth 1 --branch "$TARGET_BRANCH" "$GIT_CMD_REPOSITORY" "$CLONE_DIR"
|
git clone --single-branch --depth 1 --branch "$TARGET_BRANCH" "$GIT_CMD_REPOSITORY" "$CLONE_DIR"
|
||||||
} || {
|
} || {
|
||||||
if [ "$CREATE_TARGET_BRANCH_IF_NEEDED" = 'true' ] ; then
|
if [ "$CREATE_TARGET_BRANCH_IF_NEEDED" = "true" ]
|
||||||
|
then
|
||||||
|
# Default branch of the repository is cloned. Later on the required branch
|
||||||
|
# will be created
|
||||||
git clone --single-branch --depth 1 "$GIT_CMD_REPOSITORY" "$CLONE_DIR"
|
git clone --single-branch --depth 1 "$GIT_CMD_REPOSITORY" "$CLONE_DIR"
|
||||||
else
|
else
|
||||||
false
|
false
|
||||||
|
@ -145,8 +148,9 @@ echo "[+] Set directory is safe ($CLONE_DIR)"
|
||||||
git config --global --add safe.directory "$CLONE_DIR"
|
git config --global --add safe.directory "$CLONE_DIR"
|
||||||
|
|
||||||
|
|
||||||
if [ "$CREATE_TARGET_BRANCH_IF_NEEDED" = 'true' ] ; then
|
if [ "$CREATE_TARGET_BRANCH_IF_NEEDED" = "true" ]
|
||||||
git checkout -b "$TARGET_BRANCH"
|
then
|
||||||
|
git switch -c "$TARGET_BRANCH"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "[+] Adding git commit"
|
echo "[+] Adding git commit"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user