Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: skip commit message sync for platform=local #22423

Merged
merged 1 commit into from May 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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[]> {
rarkins marked this conversation as resolved.
Show resolved Hide resolved
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