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

Git uri handler clone should preserve branch #158386

Closed
Tracked by #160047
joyceerhl opened this issue Aug 17, 2022 · 2 comments · Fixed by #159481 or #160922
Closed
Tracked by #160047

Git uri handler clone should preserve branch #158386

joyceerhl opened this issue Aug 17, 2022 · 2 comments · Fixed by #159481 or #160922
Assignees
Labels
feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders on-testplan

Comments

@joyceerhl
Copy link
Contributor

  1. Invoke vscode-insiders://git.clone?https://github.com/microsoft/vscode/tree/release/1.70
  2. Select a directory to clone your repo into
  3. Open cloned repo
  4. 🐛 branch context is not preserved

This impacts Continue Working On--branch context is preserved for Clone in Container and Create New Codespace.

I propose adding a new optional query parameter to the uri handler here:

private clone(uri: Uri): void {
const data = querystring.parse(uri.query);
if (!data.url) {
console.warn('Failed to open URI:', uri);
return;
}

and passing that to the git.clone command as an optional argument here

commands.executeCommand('git.clone', cloneUri.toString(true));

Then after cloning here:

const repositoryPath = await window.withProgress(
opts,
(progress, token) => this.git.clone(url!, { parentPath: parentPath!, progress, recursive: options.recursive }, token)
);

and before opening the repo in a new window, we would perform the ref checkout:

if (ref) {
    const repository = this.model.getRepository(Uri.file(repositoryPath));
    await repository?.checkout(ref);
}
@joyceerhl joyceerhl added the feature-request Request for new features or functionality label Aug 17, 2022
@joyceerhl joyceerhl added this to the Backlog milestone Aug 17, 2022
@joyceerhl joyceerhl modified the milestones: Backlog, September 2022 Aug 26, 2022
@VSCodeTriageBot VSCodeTriageBot added unreleased Patch has not yet been released in VS Code Insiders insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Aug 31, 2022
@joyceerhl joyceerhl reopened this Sep 14, 2022
@VSCodeTriageBot VSCodeTriageBot removed the insiders-released Patch has been released in VS Code Insiders label Sep 14, 2022
@VSCodeTriageBot VSCodeTriageBot added unreleased Patch has not yet been released in VS Code Insiders insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Sep 15, 2022
@lszomoru
Copy link
Member

@joyceerhl, will you create a test plan item/verification steps for this feature?

@joyceerhl
Copy link
Contributor Author

@lszomoru yes I will!

@github-actions github-actions bot locked and limited conversation to collaborators Oct 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders on-testplan
Projects
None yet
3 participants