Skip to content

Commit

Permalink
fix(git): don’t throw when obsolete ref deletion fails (#19790)
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins committed Jan 11, 2023
1 parent 4464595 commit a0cbd89
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/util/git/index.ts
Expand Up @@ -1195,11 +1195,16 @@ export async function clearRenovateRefs(): Promise<void> {
/* istanbul ignore else */
if (bulkChangesDisallowed(err)) {
for (const ref of obsoleteRefs) {
const pushOpts = ['--delete', 'origin', ref];
await git.push(pushOpts);
try {
const pushOpts = ['--delete', 'origin', ref];
await git.push(pushOpts);
} catch (err) /* istanbul ignore next */ {
logger.debug({ err }, 'Error deleting obsolete refs');
break;
}
}
} else {
throw err;
logger.warn({ err }, 'Error deleting obsolete refs');
}
}
}
Expand Down

0 comments on commit a0cbd89

Please sign in to comment.