Skip to content

Commit e5b0a78

Browse files
committed
Merge branch 'topic/ci' into 'master'
Remove backticks, their use is incorrect. See merge request eng/ide/ada_language_server!1231
2 parents 6f36d1b + 0ef02ef commit e5b0a78

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

.gitlab-ci.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,18 @@ stages:
4747
4848
# On downstream pipeline checkout the necessary branch
4949
- if [[ "$CI_PIPELINE_SOURCE" == 'pipeline' ]]; then
50-
if `git -C $CI_PROJECT_DIR show-ref $ACI_SOURCE_BRANCH > /dev/null`; then
51-
git -C $CI_PROJECT_DIR checkout $ACI_SOURCE_BRANCH;
52-
elif `git -C $CI_PROJECT_DIR ls-remote --exit-code --heads origin $ACI_SOURCE_BRANCH > /dev/null`; then
53-
git -C $CI_PROJECT_DIR config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
54-
git -C $CI_PROJECT_DIR remote update
55-
git -C $CI_PROJECT_DIR checkout $ACI_SOURCE_BRANCH;
56-
elif `git -C $CI_PROJECT_DIR show-ref $ACI_TARGET_BRANCH > /dev/null`; then
57-
git -C $CI_PROJECT_DIR checkout $ACI_TARGET_BRANCH;
58-
elif `git -C $CI_PROJECT_DIR ls-remote --exit-code --heads origin $ACI_TARGET_BRANCH > /dev/null`; then
59-
git -C $CI_PROJECT_DIR config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
60-
git -C $CI_PROJECT_DIR remote update
61-
git -C $CI_PROJECT_DIR checkout $ACI_TARGET_BRANCH;
50+
if git -C "$CI_PROJECT_DIR" show-ref --quiet -- "$ACI_SOURCE_BRANCH"; then
51+
git -C "$CI_PROJECT_DIR" checkout -- "$ACI_SOURCE_BRANCH";
52+
elif git -C "$CI_PROJECT_DIR" ls-remote --exit-code -- origin "$ACI_SOURCE_BRANCH"; then
53+
git -C "$CI_PROJECT_DIR" config remote.origin.fetch "+refs/heads/$ACI_SOURCE_BRANCH:refs/remotes/origin/$ACI_SOURCE_BRANCH";
54+
git -C "$CI_PROJECT_DIR" remote update;
55+
git -C "$CI_PROJECT_DIR" checkout -- "$ACI_SOURCE_BRANCH";
56+
elif git -C "$CI_PROJECT_DIR" show-ref --quiet -- "$ACI_TARGET_BRANCH"; then
57+
git -C "$CI_PROJECT_DIR" checkout -- "$ACI_TARGET_BRANCH";
58+
elif git -C "$CI_PROJECT_DIR" ls-remote --exit-code -- origin "$ACI_TARGET_BRANCH"; then
59+
git -C "$CI_PROJECT_DIR" config remote.origin.fetch "+refs/heads/$ACI_TARGET_BRANCH:refs/remotes/origin/$ACI_TARGET_BRANCH";
60+
git -C "$CI_PROJECT_DIR" remote update;
61+
git -C "$CI_PROJECT_DIR" checkout -- "$ACI_TARGET_BRANCH";
6262
fi
6363
fi
6464

0 commit comments

Comments
 (0)