Skip to content

Copilot CLI - adopt new git extension API to improve applying a patch#2725

Merged
lszomoru merged 1 commit intomainfrom
lszomoru/additional-bird
Jan 7, 2026
Merged

Copilot CLI - adopt new git extension API to improve applying a patch#2725
lszomoru merged 1 commit intomainfrom
lszomoru/additional-bird

Conversation

@lszomoru
Copy link
Member

@lszomoru lszomoru commented Jan 6, 2026

Copilot AI review requested due to automatic review settings January 6, 2026 20:32
@lszomoru lszomoru enabled auto-merge January 6, 2026 20:32
@lszomoru lszomoru self-assigned this Jan 6, 2026
@lszomoru lszomoru added this to the December 2025 milestone Jan 6, 2026
Copy link
Contributor

Copilot AI left a 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 adopts a new Git extension API (diffBetweenPatch) to improve the process of applying patches from worktrees. The change simplifies the existing code by replacing a multi-step approach (getting diff stats then fetching individual patches) with a single API call that returns the complete patch directly.

Key changes:

  • Adds diffBetweenPatch method to the Git extension API type definitions
  • Updates IGitService interface and all implementations to make the path parameter optional
  • Refactors applyWorktreeChanges to use the new API, eliminating the need for multiple diff calls and array coalescing

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/platform/git/vscode/git.d.ts Adds diffBetweenPatch method signature to Repository interface
src/platform/git/common/gitService.ts Updates IGitService interface to make path parameter optional in diffBetweenPatch
src/platform/git/vscode/gitServiceImpl.ts Updates implementation to call the new diffBetweenPatch API method (previously incorrectly called diffBetween)
src/platform/test/node/simulationWorkspaceServices.ts Updates test mock to match new signature with optional path parameter
src/platform/ignore/node/test/mockGitService.ts Updates mock implementation to match new signature with optional path parameter
src/extension/chatSessions/vscode-node/chatSessionWorktreeServiceImpl.ts Simplifies patch generation by using single diffBetweenPatch call instead of multiple calls; removes unused coalesce import

@lszomoru lszomoru added this pull request to the merge queue Jan 6, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 6, 2026
@lszomoru lszomoru added this pull request to the merge queue Jan 7, 2026
Merged via the queue into main with commit 335d66c Jan 7, 2026
25 checks passed
@lszomoru lszomoru deleted the lszomoru/additional-bird branch January 7, 2026 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to apply changes from worktree to local workspace

2 participants