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',
|
'early EOF',
|
||||||
'fatal: bad config', // .gitmodules problem
|
'fatal: bad config', // .gitmodules problem
|
||||||
'expected flush after ref listing',
|
'expected flush after ref listing',
|
||||||
'[rejected] (stale info)',
|
|
||||||
];
|
];
|
||||||
for (const errorStr of externalHostFailureStrings) {
|
for (const errorStr of externalHostFailureStrings) {
|
||||||
if (err.message.includes(errorStr)) {
|
if (err.message.includes(errorStr)) {
|
||||||
|
|
|
@ -982,18 +982,25 @@ export async function fetchCommit({
|
||||||
export async function commitFiles(
|
export async function commitFiles(
|
||||||
commitConfig: CommitFilesConfig
|
commitConfig: CommitFilesConfig
|
||||||
): Promise<CommitSha | null> {
|
): Promise<CommitSha | null> {
|
||||||
const commitResult = await prepareCommit(commitConfig);
|
try {
|
||||||
if (commitResult) {
|
const commitResult = await prepareCommit(commitConfig);
|
||||||
const pushResult = await pushCommit(commitConfig);
|
if (commitResult) {
|
||||||
if (pushResult) {
|
const pushResult = await pushCommit(commitConfig);
|
||||||
const { branchName } = commitConfig;
|
if (pushResult) {
|
||||||
const { commitSha } = commitResult;
|
const { branchName } = commitConfig;
|
||||||
config.branchCommits[branchName] = commitSha;
|
const { commitSha } = commitResult;
|
||||||
config.branchIsModified[branchName] = false;
|
config.branchCommits[branchName] = commitSha;
|
||||||
return commitSha;
|
config.branchIsModified[branchName] = false;
|
||||||
|
return commitSha;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
|
} catch (err) /* istanbul ignore next */ {
|
||||||
|
if (err.message.includes('[rejected] (stale info)')) {
|
||||||
|
throw new Error(REPOSITORY_CHANGED);
|
||||||
|
}
|
||||||
|
throw err;
|
||||||
}
|
}
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getUrl({
|
export function getUrl({
|
||||||
|
|
Loading…
Reference in a new issue