Skip to content

Commit b114662

Browse files
authored
Don't validate publish state for Continue On (microsoft#186410)
1 parent 56ec765 commit b114662

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

extensions/github/src/commands.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { LinkContext, getLink, getVscodeDevHost } from './links';
1111

1212
async function copyVscodeDevLink(gitAPI: GitAPI, useSelection: boolean, context: LinkContext, includeRange = true) {
1313
try {
14-
const permalink = await getLink(gitAPI, useSelection, getVscodeDevHost(), 'headlink', context, includeRange);
14+
const permalink = await getLink(gitAPI, useSelection, true, getVscodeDevHost(), 'headlink', context, includeRange);
1515
if (permalink) {
1616
return vscode.env.clipboard.writeText(permalink);
1717
}
@@ -24,7 +24,7 @@ async function copyVscodeDevLink(gitAPI: GitAPI, useSelection: boolean, context:
2424

2525
async function openVscodeDevLink(gitAPI: GitAPI): Promise<vscode.Uri | undefined> {
2626
try {
27-
const headlink = await getLink(gitAPI, true, getVscodeDevHost(), 'headlink');
27+
const headlink = await getLink(gitAPI, true, false, getVscodeDevHost(), 'headlink');
2828
return headlink ? vscode.Uri.parse(headlink) : undefined;
2929
} catch (err) {
3030
if (!(err instanceof vscode.CancellationError)) {

extensions/github/src/links.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export function encodeURIComponentExceptSlashes(path: string) {
129129
return path.split('/').map((segment) => encodeURIComponent(segment)).join('/');
130130
}
131131

132-
export async function getLink(gitAPI: GitAPI, useSelection: boolean, hostPrefix?: string, linkType: 'permalink' | 'headlink' = 'permalink', context?: LinkContext, useRange?: boolean): Promise<string | undefined> {
132+
export async function getLink(gitAPI: GitAPI, useSelection: boolean, shouldEnsurePublished: boolean, hostPrefix?: string, linkType: 'permalink' | 'headlink' = 'permalink', context?: LinkContext, useRange?: boolean): Promise<string | undefined> {
133133
hostPrefix = hostPrefix ?? 'https://github.com';
134134
const fileAndPosition = getFileAndPosition(context);
135135
if (!fileAndPosition) {
@@ -143,7 +143,9 @@ export async function getLink(gitAPI: GitAPI, useSelection: boolean, hostPrefix?
143143
return;
144144
}
145145

146-
await ensurePublished(gitRepo, uri);
146+
if (shouldEnsurePublished) {
147+
await ensurePublished(gitRepo, uri);
148+
}
147149

148150
let repo: { owner: string; repo: string } | undefined;
149151
gitRepo.state.remotes.find(remote => {

0 commit comments

Comments
 (0)