From 1f79f22e47b00c160fe6c3f2d30212160da8211d Mon Sep 17 00:00:00 2001
From: Sergei Zharinov <zharinov@users.noreply.github.com>
Date: Tue, 15 Feb 2022 10:27:30 +0300
Subject: [PATCH] fix(util/git): Skip PR update on "force-with-lease" errors
 (#14228)

---
 lib/util/git/error.ts | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/lib/util/git/error.ts b/lib/util/git/error.ts
index e16e48b910..8e63c4cafb 100644
--- a/lib/util/git/error.ts
+++ b/lib/util/git/error.ts
@@ -22,6 +22,7 @@ export function checkForPlatformFailure(err: Error): void {
     '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)) {
@@ -120,12 +121,6 @@ export function handleCommitError(
     logger.error({ err }, 'Error committing files.');
     return null;
   }
-  if (err.message.includes('[rejected] (stale info)')) {
-    logger.info(
-      'Branch update was rejected because local copy is not up-to-date.'
-    );
-    return null;
-  }
   if (
     err.message.includes('denying non-fast-forward') ||
     err.message.includes('GH003: Sorry, force-pushing')
-- 
GitLab