mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
Don't validate publish state for Continue On (#186410)
This commit is contained in:
parent
56ec7658d3
commit
b114662b7a
|
@ -11,7 +11,7 @@ import { LinkContext, getLink, getVscodeDevHost } from './links';
|
|||
|
||||
async function copyVscodeDevLink(gitAPI: GitAPI, useSelection: boolean, context: LinkContext, includeRange = true) {
|
||||
try {
|
||||
const permalink = await getLink(gitAPI, useSelection, getVscodeDevHost(), 'headlink', context, includeRange);
|
||||
const permalink = await getLink(gitAPI, useSelection, true, getVscodeDevHost(), 'headlink', context, includeRange);
|
||||
if (permalink) {
|
||||
return vscode.env.clipboard.writeText(permalink);
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ async function copyVscodeDevLink(gitAPI: GitAPI, useSelection: boolean, context:
|
|||
|
||||
async function openVscodeDevLink(gitAPI: GitAPI): Promise<vscode.Uri | undefined> {
|
||||
try {
|
||||
const headlink = await getLink(gitAPI, true, getVscodeDevHost(), 'headlink');
|
||||
const headlink = await getLink(gitAPI, true, false, getVscodeDevHost(), 'headlink');
|
||||
return headlink ? vscode.Uri.parse(headlink) : undefined;
|
||||
} catch (err) {
|
||||
if (!(err instanceof vscode.CancellationError)) {
|
||||
|
|
|
@ -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 => {
|
||||
|
|
Loading…
Reference in a new issue