From 67d82c5f16a6619a62bf12128917e0267d35fb59 Mon Sep 17 00:00:00 2001
From: Jamie Magee <JamieMagee@users.noreply.github.com>
Date: Mon, 18 Nov 2019 00:54:08 +0100
Subject: [PATCH] fix(azure): remove 'refs/heads/' from target branch (#4820)

Azure DevOps returns the target branch in the form of `/ref/heads/master`, but Renovate expects just `master`

Fixes #4812
---
 lib/platform/azure/azure-helper.ts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/platform/azure/azure-helper.ts b/lib/platform/azure/azure-helper.ts
index b14d6b8d0c..fdec24ecd3 100644
--- a/lib/platform/azure/azure-helper.ts
+++ b/lib/platform/azure/azure-helper.ts
@@ -177,7 +177,7 @@ export function getRenovatePRFormat(azurePr: {
   pr.displayNumber = `Pull Request #${azurePr.pullRequestId}`;
   pr.number = azurePr.pullRequestId;
   pr.body = azurePr.description;
-  pr.targetBranch = azurePr.targetRefName;
+  pr.targetBranch = getBranchNameWithoutRefsheadsPrefix(azurePr.targetRefName);
 
   // status
   // export declare enum PullRequestStatus {
-- 
GitLab