From 2f3befaf48742029d29a133d38b3e5ed98d5950e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Le=20Meur?= <91831478+lemeurherve@users.noreply.github.com> Date: Thu, 24 Mar 2022 13:33:05 +0100 Subject: [PATCH] fix: enable long paths for git to avoid problems with tests on Windows agents (#334) Ref: https://github.com/jenkins-infra/helpdesk/issues/2847 Co-authored-by: Tim Jacomb <21194782+timja@users.noreply.github.com> Co-authored-by: James Nord --- vars/infra.groovy | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vars/infra.groovy b/vars/infra.groovy index 32d5f402..dde4e6c6 100644 --- a/vars/infra.groovy +++ b/vars/infra.groovy @@ -34,6 +34,11 @@ Object checkout(String repo = null) { } Object checkoutSCM(String repo = null) { + // Enable long paths to avoid problems with tests on Windows agents + if (!isUnix()) { + bat 'git config --global core.longpaths true' + } + if (env.BRANCH_NAME) { checkout scm } else if ((env.BRANCH_NAME == null) && (repo)) {