diff --git a/lib/util/git/index.ts b/lib/util/git/index.ts
index b141f094506415a7508441659621941772a32376..0f55698aeb41f4f3d76e269ae3ea4e93dd0e514b 100644
--- a/lib/util/git/index.ts
+++ b/lib/util/git/index.ts
@@ -512,7 +512,7 @@ export async function isBranchModified(branchName: string): Promise<boolean> {
       ])
     ).trim();
   } catch (err) /* istanbul ignore next */ {
-    if (err.messages?.includes('fatal: bad revision')) {
+    if (err.message?.includes('fatal: bad revision')) {
       logger.debug(
         { err },
         'Remote branch not found when checking last commit author - aborting run'