From 98075b5e9d29eb231e33177b216249e69f0cc912 Mon Sep 17 00:00:00 2001 From: Anton Chernov Date: Wed, 10 Oct 2018 15:26:55 +0200 Subject: [PATCH] Improved git reset for CI builds --- ci/Jenkinsfile_utils.groovy | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ci/Jenkinsfile_utils.groovy b/ci/Jenkinsfile_utils.groovy index e2b08555d6a8..43f296aacc58 100644 --- a/ci/Jenkinsfile_utils.groovy +++ b/ci/Jenkinsfile_utils.groovy @@ -26,8 +26,11 @@ def init_git() { // retries as this will increase the amount of requests and worsen the throttling timeout(time: 15, unit: 'MINUTES') { checkout scm - sh 'git submodule update --init --recursive' sh 'git clean -xdff' + sh 'git reset --hard' + sh 'git submodule update --init --recursive' + sh 'git submodule foreach --recursive git clean -ffxd' + sh 'git submodule foreach --recursive git reset --hard' } } catch (exc) { deleteDir() @@ -45,8 +48,11 @@ def init_git_win() { // retries as this will increase the amount of requests and worsen the throttling timeout(time: 15, unit: 'MINUTES') { checkout scm - bat 'git submodule update --init --recursive' bat 'git clean -xdff' + bat 'git reset --hard' + bat 'git submodule update --init --recursive' + bat 'git submodule foreach --recursive git clean -ffxd' + bat 'git submodule foreach --recursive git reset --hard' } } catch (exc) { deleteDir()