Skip to content

Commit

Permalink
feat: add fingerprint to old branches (#17393)
Browse files Browse the repository at this point in the history
  • Loading branch information
RahulGautamSingh committed Aug 25, 2022
1 parent 0ca4794 commit bf378a4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
8 changes: 7 additions & 1 deletion lib/workers/repository/process/write.spec.ts
Expand Up @@ -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,
Expand Down
7 changes: 4 additions & 3 deletions lib/workers/repository/process/write.ts
Expand Up @@ -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 &&
Expand Down

0 comments on commit bf378a4

Please sign in to comment.