diff --git a/lib/util/git/index.ts b/lib/util/git/index.ts index 829f18abe8cdcd..390d0f07c38531 100644 --- a/lib/util/git/index.ts +++ b/lib/util/git/index.ts @@ -450,13 +450,19 @@ export function getBranchList(): string[] { export async function isBranchStale(branchName: string): Promise { await syncBranch(branchName); try { + const { currentBranchSha, currentBranch } = config; const branches = await git.branch([ '--remotes', '--verbose', '--contains', config.currentBranchSha, ]); - return !branches.all.map(localName).includes(branchName); + const isStale = !branches.all.map(localName).includes(branchName); + logger.debug( + { isStale, branches, currentBranch, currentBranchSha }, + `IsBranchStale=${isStale}` + ); + return isStale; } catch (err) /* istanbul ignore next */ { checkForPlatformFailure(err); throw err;