Don't validate publish state for Continue On (#186410)

This commit is contained in:
Joyce Er
2023-06-27 11:50:52 -07:00
committed by GitHub
parent 56ec7658d3
commit b114662b7a
2 changed files with 6 additions and 4 deletions

View File

@@ -129,7 +129,7 @@ export function encodeURIComponentExceptSlashes(path: string) {
return path.split('/').map((segment) => encodeURIComponent(segment)).join('/');
}
export async function getLink(gitAPI: GitAPI, useSelection: boolean, hostPrefix?: string, linkType: 'permalink' | 'headlink' = 'permalink', context?: LinkContext, useRange?: boolean): Promise<string | undefined> {
export async function getLink(gitAPI: GitAPI, useSelection: boolean, shouldEnsurePublished: boolean, hostPrefix?: string, linkType: 'permalink' | 'headlink' = 'permalink', context?: LinkContext, useRange?: boolean): Promise<string | undefined> {
hostPrefix = hostPrefix ?? 'https://github.com';
const fileAndPosition = getFileAndPosition(context);
if (!fileAndPosition) {
@@ -143,7 +143,9 @@ export async function getLink(gitAPI: GitAPI, useSelection: boolean, hostPrefix?
return;
}
await ensurePublished(gitRepo, uri);
if (shouldEnsurePublished) {
await ensurePublished(gitRepo, uri);
}
let repo: { owner: string; repo: string } | undefined;
gitRepo.state.remotes.find(remote => {