From e227ea3567227b342d08514018914c93608c83f8 Mon Sep 17 00:00:00 2001
From: William Godbe <wigodbe@microsoft.com>
Date: Fri, 10 Jun 2022 17:09:15 -0700
Subject: [PATCH] Fix branch names again (#42131)

* Fix branch names again

* Update azure-pipelines-mirror-within-azdo.yml

* Update azure-pipelines-mirror-within-azdo.yml
---
 .../pipelines/azure-pipelines-mirror-within-azdo.yml   | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/.azure/pipelines/azure-pipelines-mirror-within-azdo.yml b/.azure/pipelines/azure-pipelines-mirror-within-azdo.yml
index 4c9df822fd6..73c74da9937 100644
--- a/.azure/pipelines/azure-pipelines-mirror-within-azdo.yml
+++ b/.azure/pipelines/azure-pipelines-mirror-within-azdo.yml
@@ -33,11 +33,13 @@ jobs:
           value: repo-dir
         - name: AzdoRepo
           value: dotnet-aspnetcore
-        - name: TargetBranchName
-          value: $(Build.SourceBranchName)-nonstable
-        - name: BranchToMirror
-          value: $(Build.SourceBranchName)
         steps:
+        - powershell: |
+            $branch = "$(Build.SourceBranch)".Replace("refs/heads/", "");
+            $suffix = "-nonstable"
+            Write-Host "##vso[task.setvariable variable=BranchToMirror]$branch"
+            Write-Host "##vso[task.setvariable variable=TargetBranchName]$branch+$suffix"
+          displayName: Calculate Mirrored Branch Names
         - script: |
             git clone https://dn-bot:$(dn-bot-dnceng-build-rw-code-rw)@dev.azure.com/dnceng/internal/_git/$(AzdoRepo) $(WorkingDirectoryName) --recursive --no-tags --branch $(TargetBranchName)
           displayName: Clone AzDO repo
-- 
GitLab