Thanks to visit codestin.com
Credit goes to github.com

Skip to content

New file in PR shows as empty in extension but displays correctly on web #8446

@OlliTapio

Description

@OlliTapio

Description

When viewing a PR that adds a new file, the file appears empty in the VS Code extension's PR diff view, but displays correctly on the GitHub web interface.

Steps to Reproduce

  1. Create a PR that adds a new file (in this case, a Python test file with ~87 lines)
  2. Open the PR in VS Code using the GitHub Pull Requests extension
  3. View the new file in the PR diff

Expected Behavior

The new file should display its full contents in the diff view.

Actual Behavior

The file appears empty in the extension, while the same file shows correctly with all 87 lines on the GitHub web UI.

Environment

  • VS Code version: (latest)
  • Extension version: (latest)
  • OS: macOS
  • Using multiple git worktrees

Additional Context

  • The file was confirmed to exist on GitHub with correct content (3291 bytes)
  • gh pr diff CLI shows the file correctly
  • GitHub web UI shows the file correctly
  • Only the VS Code extension shows the file as empty

Note: We are working with multiple git worktrees, which might be the cause of this bug. Worktrees seem to cause various issues with VS Code extensions in general. The PR was created from a worktree rather than the main repository checkout.

This may be a caching issue or a problem with how newly added files are fetched/displayed when working in a worktree context.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions