Skip to content

Render content-identical renames using the previous file path - #8907

Merged
Alex Ross (alexr00) merged 4 commits into
mainfrom
copilot/fix-file-rename-diff-issue
Aug 27, 2026
Merged

Render content-identical renames using the previous file path#8907
Alex Ross (alexr00) merged 4 commits into
mainfrom
copilot/fix-file-rename-diff-issue

Conversation

Copilot AI commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Content-identical renames rendered as new files because base content was requested from the destination path, leaving the base pane empty.

  • Base resolution
    • Load renamed files from previousFileName at the base commit.
    • Preserve current-path lookup for other change types.
const basePath = status === GitChangeType.RENAME
	? previousFileName
	: fileName;
  • Regression coverage
    • Verify no-patch renames request base content from the original path.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI and others added 2 commits August 27, 2026 11:27
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix rename file issue showing as new file in PR diff Render content-identical renames using the previous file path Aug 27, 2026
@alexr00
Alex Ross (alexr00) marked this pull request as ready for review August 27, 2026 12:02
Copilot AI lite review requested due to automatic review settings August 27, 2026 12:02
@alexr00
Alex Ross (alexr00) enabled auto-merge (squash) August 27, 2026 12:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes rendering of content-identical renames in the PR diff by resolving base-side file content from the previous path (so the base pane isn’t empty and the rename doesn’t appear as a 100% new file).

Changes:

  • Update GitFileChangeModel.showBase() to load base content for RENAME changes from previousFileName (for InMemFileChange / SlimFileChange) instead of the destination path.
  • Add a regression test ensuring repository.show() is called with the previous filename for rename base content.
  • Update the proposed VS Code chat API type definition for ChatResponseAutoModeResolutionPart (appears unrelated to the rename fix).
Show a summary per file
File Description
src/view/fileChangeModel.ts Resolves base-content lookup for renames using previousFileName when applicable.
src/test/view/fileChangeModel.test.ts Adds regression coverage for base-content resolution on content-identical renames.
src/@types/vscode.proposed.chatParticipantAdditions.d.ts Updates proposed API types/doc for auto-model routing resolution part.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 2/3 changed files
  • Comments generated: 0
  • Review effort level: Lite

@alexr00
Alex Ross (alexr00) merged commit b1ec746 into main Aug 27, 2026
7 checks passed
@alexr00
Alex Ross (alexr00) deleted the copilot/fix-file-rename-diff-issue branch August 27, 2026 13:19
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.

Renamed file with no content changes is shown as a 100% new file in the PR diff

4 participants