From d304945b74ee11a4077a90d0b6205a4b2ed59b32 Mon Sep 17 00:00:00 2001 From: VS MobileTools Engineering Service 2 Date: Tue, 27 Aug 2024 01:47:00 -0700 Subject: [PATCH] Fix calculating the branch name if BRANCH_NAME isn't set. (#21115) BRANCH_NAME is the variable Jenkins used, so add support for the variable Azure DevOps uses (BUILD_SOURCEBRANCH). Backport of #21114 --------- Co-authored-by: Rolf Bjarne Kvinge --- Make.config | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Make.config b/Make.config index 8a25b948d46c..e0b852fec448 100644 --- a/Make.config +++ b/Make.config @@ -56,7 +56,11 @@ PACKAGE_HEAD_REV=$(shell git rev-parse HEAD) # This is done in Make.versions, not here. # -ifeq ($(BRANCH_NAME),) +ifneq ($(BUILD_SOURCEBRANCH),) +# BUILD_SOURCEBRANCH is set in Azure DevOps, so use that value if it exists +# it seems to always start with refs/heads/, so strip off that first. +CURRENT_BRANCH:=$(subst refs/heads,,${BUILD_SOURCEBRANCH}) +else ifeq ($(BRANCH_NAME),) # BRANCH_NAME is set in Jenkins, so this is for local builds. CURRENT_BRANCH:=$(shell git rev-parse --abbrev-ref HEAD) else