Skip to content
Snippets Groups Projects
Commit e46966e3 authored by Rhys Arkins's avatar Rhys Arkins
Browse files

refactor: remove unused isGitHub/etc

parent 2946f29e
No related branches found
No related tags found
No related merge requests found
...@@ -63,11 +63,6 @@ async function getParentBranch(config) { ...@@ -63,11 +63,6 @@ async function getParentBranch(config) {
logger.debug('PR is conflicted'); logger.debug('PR is conflicted');
if (pr.canRebase) { if (pr.canRebase) {
logger.info(`Branch is not mergeable and needs rebasing`); 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 // Setting parentBranch back to undefined means that we'll use the default branch
return { parentBranch: undefined }; return { parentBranch: undefined };
} }
......
...@@ -104,11 +104,6 @@ async function getRepositoryConfig(globalConfig, repository) { ...@@ -104,11 +104,6 @@ async function getRepositoryConfig(globalConfig, repository) {
globalConfig, globalConfig,
is.string(repository) ? { repository } : repository 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.localDir = path.join(
repoConfig.baseDir, repoConfig.baseDir,
`./repos/${repoConfig.platform}/${repoConfig.repository}` `./repos/${repoConfig.platform}/${repoConfig.repository}`
......
...@@ -75,17 +75,6 @@ describe('workers/branch/parent', () => { ...@@ -75,17 +75,6 @@ describe('workers/branch/parent', () => {
const res = await getParentBranch(config); const res = await getParentBranch(config);
expect(res.parentBranch).toBeUndefined(); 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 () => { it('returns branchName if automerge branch and not stale', async () => {
config.automerge = true; config.automerge = true;
config.automergeType = 'branch'; config.automergeType = 'branch';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment