Skip to content

Commit

Permalink
fix: skip commit message sync for platform=local (#22423)
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins committed May 25, 2023
1 parent 2fba61a commit 0fc01f5
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions lib/util/git/index.ts
Expand Up @@ -504,13 +504,19 @@ export function getBranchCommit(branchName: string): CommitSha | null {
}

export async function getCommitMessages(): Promise<string[]> {
await syncGit();
logger.debug('getCommitMessages');
const res = await git.log({
n: 20,
format: { message: '%s' },
});
return res.all.map((commit) => commit.message);
if (GlobalConfig.get('platform') !== 'local') {
await syncGit();
}
try {
const res = await git.log({
n: 20,
format: { message: '%s' },
});
return res.all.map((commit) => commit.message);
} catch (err) /* istanbul ignore next */ {
return [];
}
}

export async function checkoutBranch(branchName: string): Promise<CommitSha> {
Expand Down

0 comments on commit 0fc01f5

Please sign in to comment.