Skip to content

Commit 8a49c72

Browse files
committed
git checkout doesn't support '--' when branch name is specified.
1 parent e5b0a78 commit 8a49c72

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.gitlab-ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,17 @@ stages:
4848
# On downstream pipeline checkout the necessary branch
4949
- if [[ "$CI_PIPELINE_SOURCE" == 'pipeline' ]]; then
5050
if git -C "$CI_PROJECT_DIR" show-ref --quiet -- "$ACI_SOURCE_BRANCH"; then
51-
git -C "$CI_PROJECT_DIR" checkout -- "$ACI_SOURCE_BRANCH";
51+
git -C "$CI_PROJECT_DIR" checkout "$ACI_SOURCE_BRANCH";
5252
elif git -C "$CI_PROJECT_DIR" ls-remote --exit-code -- origin "$ACI_SOURCE_BRANCH"; then
5353
git -C "$CI_PROJECT_DIR" config remote.origin.fetch "+refs/heads/$ACI_SOURCE_BRANCH:refs/remotes/origin/$ACI_SOURCE_BRANCH";
5454
git -C "$CI_PROJECT_DIR" remote update;
55-
git -C "$CI_PROJECT_DIR" checkout -- "$ACI_SOURCE_BRANCH";
55+
git -C "$CI_PROJECT_DIR" checkout "$ACI_SOURCE_BRANCH";
5656
elif git -C "$CI_PROJECT_DIR" show-ref --quiet -- "$ACI_TARGET_BRANCH"; then
57-
git -C "$CI_PROJECT_DIR" checkout -- "$ACI_TARGET_BRANCH";
57+
git -C "$CI_PROJECT_DIR" checkout "$ACI_TARGET_BRANCH";
5858
elif git -C "$CI_PROJECT_DIR" ls-remote --exit-code -- origin "$ACI_TARGET_BRANCH"; then
5959
git -C "$CI_PROJECT_DIR" config remote.origin.fetch "+refs/heads/$ACI_TARGET_BRANCH:refs/remotes/origin/$ACI_TARGET_BRANCH";
6060
git -C "$CI_PROJECT_DIR" remote update;
61-
git -C "$CI_PROJECT_DIR" checkout -- "$ACI_TARGET_BRANCH";
61+
git -C "$CI_PROJECT_DIR" checkout "$ACI_TARGET_BRANCH";
6262
fi
6363
fi
6464

0 commit comments

Comments
 (0)