diff --git a/lib/api/github.js b/lib/api/github.js
index cccc9d9eff0f811c71784f1c08395772651c8493..8bb9d241edca57dc1b24375e4cb4e971a24b26f5 100644
--- a/lib/api/github.js
+++ b/lib/api/github.js
@@ -386,10 +386,12 @@ async function getPr(prNo) {
   }
   if (!pr.isClosed) {
     if (pr.mergeable_state === 'dirty') {
+      logger.debug(`PR mergeable state is dirty`);
       pr.isUnmergeable = true;
     }
     if (pr.commits === 1) {
       // Only one commit was made - must have been renovate
+      logger.debug('Only 1 commit in PR so rebase is possible');
       pr.canRebase = true;
     } else {
       // Check if only one author of all commits
diff --git a/lib/workers/branch.js b/lib/workers/branch.js
index bd5cf53138820fe3201145bde84cbd12d1591c44..44c5464f7a1d921ab094bf2206ac3aae9187b88a 100644
--- a/lib/workers/branch.js
+++ b/lib/workers/branch.js
@@ -42,15 +42,13 @@ async function getParentBranch(branchName, config) {
   if (pr.isUnmergeable) {
     logger.debug('PR is unmergeable');
     if (pr.canRebase) {
-      if (config.platform === 'github') {
-        // Setting parentBranch back to undefined means that we'll use the default branch
-        logger.info(`Branch is not mergeable and needs rebasing`);
-        return undefined;
-      } else if (config.platform === 'gitlab') {
+      logger.info(`Branch is not mergeable and needs rebasing`);
+      if (config.isGitLab) {
         logger.info(`Deleting unmergeable branch in order to recreate/rebase`);
         await config.api.deleteBranch(branchName);
-        return undefined;
       }
+      // Setting parentBranch back to undefined means that we'll use the default branch
+      return undefined;
     }
     // Don't do anything different, but warn
     logger.warn(`Branch is not mergeable but can't be rebased`);
diff --git a/lib/workers/global.js b/lib/workers/global.js
index ce87cd61829e5f34e178bbbd2f06b9a98aefd44d..be3c78b87846904d6cb72b64539fe6ef19b1b590 100644
--- a/lib/workers/global.js
+++ b/lib/workers/global.js
@@ -34,5 +34,6 @@ function getRepositoryConfig(globalConfig, index) {
     repository: repoConfig.repository,
   });
   repoConfig.isGitHub = repoConfig.platform === 'github';
+  repoConfig.isGitLab = repoConfig.platform === 'gitlab';
   return configParser.filterConfig(repoConfig, 'repository');
 }
diff --git a/test/workers/branch.spec.js b/test/workers/branch.spec.js
index 017424403801e55e5849c1bfcbaa0371f1ba84f1..d61389b36e5f5b1f72a6d239ce8fff05c56c5fc8 100644
--- a/test/workers/branch.spec.js
+++ b/test/workers/branch.spec.js
@@ -16,7 +16,6 @@ describe('workers/branch', () => {
     const branchName = 'foo';
     beforeEach(() => {
       config = {
-        platform: 'github',
         api: {
           branchExists: jest.fn(() => true),
           deleteBranch: jest.fn(),
@@ -65,7 +64,7 @@ describe('workers/branch', () => {
       );
     });
     it('returns undefined if unmergeable and can rebase (gitlab)', async () => {
-      config.platform = 'gitlab';
+      config.isGitLab = true;
       config.api.getBranchPr.mockReturnValue({
         isUnmergeable: true,
         canRebase: true,