gitlab-ci: Explicitly fetch target branch
authorBen Gamari <ben@smart-cactus.org>
Sat, 23 Mar 2019 00:53:32 +0000 (20:53 -0400)
committerBen Gamari <ben@smart-cactus.org>
Sat, 23 Mar 2019 16:37:56 +0000 (12:37 -0400)
`git fetch`, which we used previously, doesn't update the remote
tracking branches.

.gitlab-ci.yml

index f22354a..7da7c41 100644 (file)
@@ -47,8 +47,8 @@ ghc-linters:
   stage: lint
   image: "registry.gitlab.haskell.org/ghc/ci-images/linters:$DOCKER_REV"
   script:
-    - git fetch origin
-    - base="$(git merge-base origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME $CI_COMMIT_SHA)"
+    - git fetch origin $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
+    - base="$(git merge-base FETCH_HEAD $CI_COMMIT_SHA)"
     - "echo Merge base $base"
     #    - validate-commit-msg .git $(git rev-list $base..$CI_COMMIT_SHA)
     - validate-whitespace .git $(git rev-list $base..$CI_COMMIT_SHA)