mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 10:38:59 +01:00
Allow ref checkout after protocol handler clone (#159481)
This commit is contained in:
@@ -25,6 +25,7 @@ export class GitProtocolHandler implements UriHandler {
|
||||
|
||||
private clone(uri: Uri): void {
|
||||
const data = querystring.parse(uri.query);
|
||||
const ref = data.ref;
|
||||
|
||||
if (!data.url) {
|
||||
console.warn('Failed to open URI:', uri);
|
||||
@@ -36,6 +37,11 @@ export class GitProtocolHandler implements UriHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ref !== undefined && typeof ref !== 'string') {
|
||||
console.warn('Failed to open URI:', uri);
|
||||
return;
|
||||
}
|
||||
|
||||
let cloneUri: Uri;
|
||||
try {
|
||||
let rawUri = Array.isArray(data.url) ? data.url[0] : data.url;
|
||||
@@ -56,7 +62,7 @@ export class GitProtocolHandler implements UriHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
commands.executeCommand('git.clone', cloneUri.toString(true));
|
||||
commands.executeCommand('git.clone', cloneUri.toString(true), undefined, { ref: ref });
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
|
||||
Reference in New Issue
Block a user