Sessions - add noTrack option to worktree creation and adopt new option#308471
Merged
Sessions - add noTrack option to worktree creation and adopt new option#308471
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the Git extension’s worktree creation plumbing to support a noTrack option (mapped to git worktree add --no-track) and adopts that option in Copilot Sessions worktree creation to avoid configuring upstream tracking for the created branch.
Changes:
- Add an optional
noTrack?: booleantoRepository.createWorktree(...)and wire it through to the underlyinggit worktree addinvocation. - Update the Git extension API typings and API wrapper to expose the new option.
- Update Copilot’s git service abstractions/mocks and set
noTrack: truewhen creating session worktrees.
Show a summary per file
| File | Description |
|---|---|
| extensions/git/src/repository.ts | Thread noTrack through Repository.createWorktree into the underlying git repository implementation. |
| extensions/git/src/git.ts | Add support for --no-track in worktree add argument construction. |
| extensions/git/src/api/git.d.ts | Expose the new noTrack option on the Git extension’s public createWorktree API typing. |
| extensions/git/src/api/api1.ts | Keep the API wrapper signature in sync with the updated createWorktree options. |
| extensions/copilot/src/platform/test/node/simulationWorkspaceServices.ts | Update test service interface typing to include noTrack. |
| extensions/copilot/src/platform/ignore/node/test/mockGitService.ts | Update mock git service typing to include noTrack. |
| extensions/copilot/src/platform/git/vscode/git.d.ts | Update Copilot’s vendored Git API typing to include noTrack. |
| extensions/copilot/src/platform/git/vscode-node/gitServiceImpl.ts | Update createWorktree signature to accept and forward noTrack. |
| extensions/copilot/src/platform/git/common/gitService.ts | Update IGitService.createWorktree options typing to include noTrack. |
| extensions/copilot/src/extension/chatSessions/vscode-node/chatSessionWorktreeServiceImpl.ts | Adopt noTrack: true for Copilot session worktree creation. |
Copilot's findings
- Files reviewed: 8/10 changed files
- Comments generated: 0
alexdima
approved these changes
Apr 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #308465