mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 23:16:26 +00:00
fix(git): treat stale rejection as REPOSITORY_CHANGED (#14829)
This commit is contained in:
parent
25d793f690
commit
00c74a9ca2
2 changed files with 17 additions and 11 deletions
|
@ -22,7 +22,6 @@ export function checkForPlatformFailure(err: Error): Error | null {
|
|||
'early EOF',
|
||||
'fatal: bad config', // .gitmodules problem
|
||||
'expected flush after ref listing',
|
||||
'[rejected] (stale info)',
|
||||
];
|
||||
for (const errorStr of externalHostFailureStrings) {
|
||||
if (err.message.includes(errorStr)) {
|
||||
|
|
|
@ -982,6 +982,7 @@ export async function fetchCommit({
|
|||
export async function commitFiles(
|
||||
commitConfig: CommitFilesConfig
|
||||
): Promise<CommitSha | null> {
|
||||
try {
|
||||
const commitResult = await prepareCommit(commitConfig);
|
||||
if (commitResult) {
|
||||
const pushResult = await pushCommit(commitConfig);
|
||||
|
@ -994,6 +995,12 @@ export async function commitFiles(
|
|||
}
|
||||
}
|
||||
return null;
|
||||
} catch (err) /* istanbul ignore next */ {
|
||||
if (err.message.includes('[rejected] (stale info)')) {
|
||||
throw new Error(REPOSITORY_CHANGED);
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
export function getUrl({
|
||||
|
|
Loading…
Reference in a new issue