From 2ed82a99a4d825479a40f28de3b4d94b1f63a74c Mon Sep 17 00:00:00 2001 From: kallrobin <Kallrobin92@gmail.com> Date: Thu, 27 Jun 2019 09:47:25 +0200 Subject: [PATCH] fix(bitbucket): add canMerge to pr (#3961) --- lib/platform/bitbucket/index.ts | 1 + test/platform/bitbucket/__snapshots__/index.spec.ts.snap | 2 ++ 2 files changed, 3 insertions(+) diff --git a/lib/platform/bitbucket/index.ts b/lib/platform/bitbucket/index.ts index c60028a1a0..2bd1637ae4 100644 --- a/lib/platform/bitbucket/index.ts +++ b/lib/platform/bitbucket/index.ts @@ -540,6 +540,7 @@ export async function getPr(prNo: number) { const commits = await utils.accumulateValues(pr.links.commits.href); if (commits.length === 1) { res.canRebase = true; + res.canMerge = true; } } if (await branchExists(pr.source.branch.name)) { diff --git a/test/platform/bitbucket/__snapshots__/index.spec.ts.snap b/test/platform/bitbucket/__snapshots__/index.spec.ts.snap index 165aacf17d..ced5c899ec 100644 --- a/test/platform/bitbucket/__snapshots__/index.spec.ts.snap +++ b/test/platform/bitbucket/__snapshots__/index.spec.ts.snap @@ -161,6 +161,7 @@ exports[`platform/bitbucket getBranchPr() bitbucket finds PR for branch 1`] = ` Object { "body": "summary", "branchName": "branch", + "canMerge": true, "canRebase": true, "createdAt": "2018-07-02T07:02:25.275030+00:00", "displayNumber": "Pull Request #5", @@ -176,6 +177,7 @@ exports[`platform/bitbucket getPr() exists 1`] = ` Object { "body": "summary", "branchName": "branch", + "canMerge": true, "canRebase": true, "createdAt": "2018-07-02T07:02:25.275030+00:00", "displayNumber": "Pull Request #5", -- GitLab