-
Notifications
You must be signed in to change notification settings - Fork 34.7k
Enable users to view and apply changes from worktree to main repo, per file #263927
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
Conversation
extensions/git/src/repository.ts
Outdated
@@ -182,6 +182,7 @@ export class Resource implements SourceControlResourceState { | |||
get type(): Status { return this._type; } | |||
get original(): Uri { return this._resourceUri; } | |||
get renameResourceUri(): Uri | undefined { return this._renameResourceUri; } | |||
get contextValue(): string | undefined { return this._repository?.kind; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this being used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the package.json
where I set scmResourceState == worktree
https://github.com/microsoft/vscode/blob/main/src/vscode-dts/vscode.d.ts#L16389
extensions/git/src/repository.ts
Outdated
@@ -310,6 +311,7 @@ export class Resource implements SourceControlResourceState { | |||
private _type: Status, | |||
private _useIcons: boolean, | |||
private _renameResourceUri?: Uri, | |||
private _repository?: Repository, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. Let's not pass in the complete repository object but just pass in the repository kind (similar to how the ResourceGroupType is being passed in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. Lmk if you'd eventually like to make RepositoryKind an enum. I just didn't do it here because I didn't want to make a bigger change than necessary to other files.
'Compare with Workspace' is only available from a worktree's context menu under 'Changes' and opens the merge editor where users can apply changes from a worktree to its main repository.
