diff --git a/lib/workers/branch/index.ts b/lib/workers/branch/index.ts index b053b41a2ce70db53ebab04660629cff644609c9..a292b4a013c9530dea005b0bd73d8c61610400f4 100644 --- a/lib/workers/branch/index.ts +++ b/lib/workers/branch/index.ts @@ -544,6 +544,9 @@ export async function processBranch( err.message.includes('fatal: Authentication failed') ) { throw new Error(PLATFORM_AUTHENTICATION_ERROR); + } else if (err.message?.includes('fatal: bad revision')) { + logger.debug({ err }, 'Aborting job due to bad revision error'); + throw new Error(REPOSITORY_CHANGED); } else if (!(err instanceof ExternalHostError)) { logger.error({ err }, `Error updating branch: ${String(err.message)}`); }