File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -72,11 +72,14 @@ git config --global user.name "$USER_NAME"
72
72
{
73
73
git clone --single-branch --depth 1 --branch " $TARGET_BRANCH " " $GIT_CMD_REPOSITORY " " $CLONE_DIR "
74
74
} || {
75
- if [ " $CREATE_TARGET_BRANCH_IF_NEEDED " = ' true' ] ; then
76
- git clone --single-branch --depth 1 " $GIT_CMD_REPOSITORY " " $CLONE_DIR "
77
- else
78
- false
79
- fi
75
+ if [ " $CREATE_TARGET_BRANCH_IF_NEEDED " = " true" ]
76
+ then
77
+ # Default branch of the repository is cloned. Later on the required branch
78
+ # will be created
79
+ git clone --single-branch --depth 1 " $GIT_CMD_REPOSITORY " " $CLONE_DIR "
80
+ else
81
+ false
82
+ fi
80
83
} || {
81
84
echo " ::error::Could not clone the destination repository. Command:"
82
85
echo " ::error::git clone --single-branch --branch $TARGET_BRANCH $GIT_CMD_REPOSITORY $CLONE_DIR "
@@ -145,8 +148,9 @@ echo "[+] Set directory is safe ($CLONE_DIR)"
145
148
git config --global --add safe.directory " $CLONE_DIR "
146
149
147
150
148
- if [ " $CREATE_TARGET_BRANCH_IF_NEEDED " = ' true' ] ; then
149
- git checkout -b " $TARGET_BRANCH "
151
+ if [ " $CREATE_TARGET_BRANCH_IF_NEEDED " = " true" ]
152
+ then
153
+ git switch -c " $TARGET_BRANCH "
150
154
fi
151
155
152
156
echo " [+] Adding git commit"
You can’t perform that action at this time.
0 commit comments