Skip to content

Commit

Permalink
fix(git): add debug (#9683)
Browse files Browse the repository at this point in the history
  • Loading branch information
viceice committed Apr 25, 2021
1 parent c542cbe commit 00cb277
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/util/git/index.ts
Expand Up @@ -450,13 +450,19 @@ export function getBranchList(): string[] {
export async function isBranchStale(branchName: string): Promise<boolean> {
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;
Expand Down

0 comments on commit 00cb277

Please sign in to comment.