From e46966e390b0a80fffa7f67af5804e3e29f41ad5 Mon Sep 17 00:00:00 2001 From: Rhys Arkins <rhys@arkins.net> Date: Sat, 18 May 2019 18:38:46 +0200 Subject: [PATCH] refactor: remove unused isGitHub/etc --- lib/workers/branch/parent.js | 5 ----- lib/workers/global/index.js | 5 ----- test/workers/branch/parent.spec.js | 11 ----------- 3 files changed, 21 deletions(-) diff --git a/lib/workers/branch/parent.js b/lib/workers/branch/parent.js index d322a9d975..5f3c0e544f 100644 --- a/lib/workers/branch/parent.js +++ b/lib/workers/branch/parent.js @@ -63,11 +63,6 @@ async function getParentBranch(config) { logger.debug('PR is conflicted'); if (pr.canRebase) { logger.info(`Branch is not mergeable and needs rebasing`); - // TODO: Move this down to api library - if (config.isGitLab || config.isAzure) { - logger.info(`Deleting unmergeable branch in order to recreate/rebase`); - await platform.deleteBranch(branchName); - } // Setting parentBranch back to undefined means that we'll use the default branch return { parentBranch: undefined }; } diff --git a/lib/workers/global/index.js b/lib/workers/global/index.js index f95bb6fcb1..0f2517f956 100644 --- a/lib/workers/global/index.js +++ b/lib/workers/global/index.js @@ -104,11 +104,6 @@ async function getRepositoryConfig(globalConfig, repository) { globalConfig, is.string(repository) ? { repository } : repository ); - repoConfig.isBitbucket = repoConfig.platform === 'bitbucket'; - repoConfig.isBitbucketServer = repoConfig.platform === 'bitbucket-server'; - repoConfig.isGitHub = repoConfig.platform === 'github'; - repoConfig.isGitLab = repoConfig.platform === 'gitlab'; - repoConfig.isAzure = repoConfig.platform === 'azure'; repoConfig.localDir = path.join( repoConfig.baseDir, `./repos/${repoConfig.platform}/${repoConfig.repository}` diff --git a/test/workers/branch/parent.spec.js b/test/workers/branch/parent.spec.js index 1181cf9b15..876a3bdc2e 100644 --- a/test/workers/branch/parent.spec.js +++ b/test/workers/branch/parent.spec.js @@ -75,17 +75,6 @@ describe('workers/branch/parent', () => { const res = await getParentBranch(config); expect(res.parentBranch).toBeUndefined(); }); - it('returns undefined if unmergeable and can rebase (gitlab)', async () => { - config.isGitLab = true; - platform.branchExists.mockReturnValue(true); - platform.getBranchPr.mockReturnValue({ - isConflicted: true, - canRebase: true, - }); - const res = await getParentBranch(config); - expect(res.parentBranch).toBeUndefined(); - expect(platform.deleteBranch).toHaveBeenCalledTimes(1); - }); it('returns branchName if automerge branch and not stale', async () => { config.automerge = true; config.automergeType = 'branch'; -- GitLab