-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Refactor creation of work trees #1753
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
base: main
Are you sure you want to change the base?
Conversation
| return undefined; | ||
| } | ||
|
|
||
| async createWorktree(stream: vscode.ChatResponseStream): Promise<string | undefined> { |
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.
@osortega
I think getting the caller to decide whether to call this method or not is an improvement, as opposed to giving more responsibility to this method.
Callers already have all of the information using the public methods in this class.
I believe that will also improve readability as sometimes we pass in untitled id and other cases we pass in the real session id (what confuses me is the fact that here we MUST pass in the old untitled id & not the real session id).
I'd like to remove that ambiguity from this class/code.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
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.
Pull Request Overview
This PR refactors the worktree creation logic for Copilot CLI chat sessions by moving the isolation check from inside the createWorktreeIfNeeded method to its call site, and renames the method to simply createWorktree.
Key changes:
- Renamed
createWorktreeIfNeededtocreateWorktreeand removed the internal isolation check - Moved isolation preference check to the caller level, making the control flow more explicit
- Adjusted the timing of when worktree path is stored relative to session creation
No description provided.