diff --git a/lib/workers/repository/process/write.spec.ts b/lib/workers/repository/process/write.spec.ts index 3ea1ee7f50dc14..3d084b6ad9af46 100644 --- a/lib/workers/repository/process/write.spec.ts +++ b/lib/workers/repository/process/write.spec.ts @@ -120,7 +120,13 @@ describe('workers/repository/process/write', () => { }, ]); repoCache.getCache.mockReturnValueOnce({ - branches: [{ branchName: 'new/some-branch' } as BranchCache], + branches: [ + { + branchName: 'new/some-branch', + sha: '111', + branchFingerprint: '111', + } as BranchCache, + ], }); branchWorker.processBranch.mockResolvedValueOnce({ branchExists: true, diff --git a/lib/workers/repository/process/write.ts b/lib/workers/repository/process/write.ts index c3e0baf2869bf4..f356ae793c1ae4 100644 --- a/lib/workers/repository/process/write.ts +++ b/lib/workers/repository/process/write.ts @@ -96,9 +96,10 @@ export async function writeUpdates( branch.prBlockedBy = res?.prBlockedBy; branch.prNo = res?.prNo; branch.result = res?.result; - branch.branchFingerprint = res?.commitSha - ? branchFingerprint - : branchCache.branchFingerprint; + branch.branchFingerprint = + res?.commitSha || !branchCache.branchFingerprint + ? branchFingerprint + : branchCache.branchFingerprint; if ( branch.result === BranchResult.Automerged &&