diff --git a/lib/util/git/index.spec.ts b/lib/util/git/index.spec.ts index de9da6eaa15603db410f3911bdfd68b18bee77f4..63cd732cf2d1c50e08b11f9dbec5af3b918b7a74 100644 --- a/lib/util/git/index.spec.ts +++ b/lib/util/git/index.spec.ts @@ -225,6 +225,12 @@ describe('util/git/index', () => { describe('mergeBranch(branchName)', () => { it('should perform a branch merge', async () => { + const repo = Git(GlobalConfig.get('localDir')); + await repo.checkout([ + '-B', + 'renovate/future_branch', + 'origin/renovate/future_branch', + ]); await git.mergeBranch('renovate/future_branch'); const merged = await Git(origin.path).branch([ '--verbose', diff --git a/lib/util/git/index.ts b/lib/util/git/index.ts index 2b3df1332622483ad6e52e89ebd8237984b1386c..3358b96e60d01bbee920f983f22dc43c035d5d09 100644 --- a/lib/util/git/index.ts +++ b/lib/util/git/index.ts @@ -653,7 +653,6 @@ export async function mergeBranch(branchName: string): Promise<void> { try { await syncGit(); await git.reset(ResetMode.HARD); - await git.checkout(['-B', branchName, 'origin/' + branchName]); await git.checkout([ '-B', config.currentBranch,