diff --git a/lib/util/git/index.spec.ts b/lib/util/git/index.spec.ts
index 4e31c3a31510f212871f4c96351a01d9c2aebad7..1f2d16d3f6a958e7ff38d1c171268cf220813a7b 100644
--- a/lib/util/git/index.spec.ts
+++ b/lib/util/git/index.spec.ts
@@ -50,6 +50,8 @@ describe('platform/git', () => {
     await repo.addConfig('user.email', 'custom@example.com');
     await repo.commit('custom message');
 
+    await repo.checkoutBranch('renovate/equal_branch', 'master');
+
     await repo.checkout('master');
   });
 
@@ -158,8 +160,8 @@ describe('platform/git', () => {
 
   describe('getBranchCommit(branchName)', () => {
     it('should return same value for equal refs', async () => {
-      const hex = await git.getBranchCommit('renovate/past_branch');
-      expect(hex).toBe(await git.getBranchCommit('master~1'));
+      const hex = await git.getBranchCommit('renovate/equal_branch');
+      expect(hex).toBe(await git.getBranchCommit('master'));
       expect(hex).toHaveLength(40);
     });
     it('should throw if branch does not exist', async () => {