From 91d88f883b8fcb27a1ab33e77c3ac7a4bb2d1419 Mon Sep 17 00:00:00 2001
From: Antoine Regimbeau <antoine.regimbeau@c-s.fr>
Date: Tue, 14 May 2019 11:47:11 +0200
Subject: [PATCH] New before script for mac

---
 .gitlab-ci.yml | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index a546a042c6..28f627860e 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -139,8 +139,10 @@ macos-superbuild-prepare:
   extends: .common-prepare
   stage: prepare
   before_script:
-# This override the previous before_script
-    - git checkout $CI_COMMIT_REF_NAME
+    # Provision efficiently the local LFS cache before checkout
+    - git lfs fetch origin $CI_COMMIT_SHA
+    # Checkout the expected branch
+    - git checkout -f -q $CI_COMMIT_SHA
   script:
     - ctest -VV -S CI/prepare_superbuild.cmake -DIMAGE_NAME:string=otb-macos-superbuild
   artifacts:
@@ -157,7 +159,10 @@ macos-superbuild-build:
   extends: .general
   stage: build
   before_script:
-    - git checkout $CI_COMMIT_REF_NAME
+    # Provision efficiently the local LFS cache before checkout
+    - git lfs fetch origin $CI_COMMIT_SHA
+    # Checkout the expected branch
+    - git checkout -f -q $CI_COMMIT_SHA
     - ssh -o StrictHostKeyChecking=no -T git@gitlab.orfeo-toolbox.org
   after_script:
     - echo "Nothing to do for after_script"
-- 
GitLab