From 00cb277bb6d612f63a517644705e060abfde957f Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Sun, 25 Apr 2021 21:26:09 +0200 Subject: [PATCH] fix(git): add debug (#9683) --- lib/util/git/index.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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;