From 58670247b47572d4a0046c2d725d661579ab2b29 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Wed, 24 Nov 2021 21:35:17 -0300 Subject: [PATCH] Jenkins: Fix .git being lost across stash/unstash --- .ci/Jenkinsfile | 2 +- .ci/build.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/Jenkinsfile b/.ci/Jenkinsfile index 492f19875..1512084a3 100644 --- a/.ci/Jenkinsfile +++ b/.ci/Jenkinsfile @@ -106,7 +106,7 @@ def gitClone(repository, branch) { println "[-] Using git commit [${env.GIT_COMMIT}]" /* Stash data and mark it as stashed. */ - stash name: 'git' + stash name: 'git', useDefaultExcludes: false env.GIT_STASHED = 'true' } else { /* Unstash data. */ diff --git a/.ci/build.sh b/.ci/build.sh index 1fde37f68..a73d3f6c8 100644 --- a/.ci/build.sh +++ b/.ci/build.sh @@ -297,7 +297,7 @@ esac # Add git hash and copyright year. git_hash=$(git rev-parse --short HEAD 2> /dev/null) -[ -z "$git_hash" ] && git_hash=$(echo $GIT_COMMIT | cut -c 1-8) +[ -z "$git_hash" -a "$CI" = "true" ] && git_hash=$(echo $GIT_COMMIT | cut -c 1-8) [ ! -z "$git_hash" ] && cmake_flags_extra="$cmake_flags_extra -D \"EMU_GIT_HASH=$git_hash\"" cmake_flags_extra="$cmake_flags_extra -D \"EMU_COPYRIGHT_YEAR=$(date +%Y)\""