Microsoft/vscode

Git extension API branch `upstream` is undefined when repo was cloned shallow

Open

#248,328 建立於 2025年3月21日

在 GitHub 查看
 (8 留言) (0 反應) (1 負責人)TypeScript (10,221 fork)batch import
buggithelp wanted

倉庫指標

Star
 (74,848 star)
PR 合併指標
 (平均合併 11小時 43分鐘) (30 天內合併 1,000 個 PR)

描述

Description

When cloning a repository with git clone --depth 1, creating a new branch, and then attempting to create a pull request using the VSCode GitHub Pull Request extension, the following issues occur:

  1. The AI-powered PR title and description generator does not work.
  2. After creating the PR, the extension does not detect it properly.

You can post this on the [GitHub Pull Request extension's issue tracker](https://github.com/microsoft/vscode-pull-request-github/issues). Let me know if you need any modifications! 🚀

  • Extension version: 0.106.0
  • VSCode Version: 1.96.4
  • Git Version: 2.43.0
  • OS: macos sonoma
  • Repository Clone Configuration (single repository/fork of an upstream repository): fork of an upstream repository
  • Github Product (Github.com/Github Enterprise version x.x.x): Github.com

Steps to Reproduce

  1. Clone a repository with git clone --depth 1 https://github.com/hichemfantar/nextra-fork.
  2. Create and switch to a new branch:
    git checkout -b new-feature
    
  3. Make some changes and commit them.
  4. Open the GitHub Pull Request extension and attempt to create a PR.

Expected Behavior

  • The AI-powered PR title and description should generate properly.
  • The created PR should be detected by the extension.

Actual Behavior

  • The AI-powered PR title and description generator does not work.
  • The extension does not detect the created PR after it's created.

Additional Notes

  • The issue may be caused by the shallow clone preventing the extension from accessing full branch history.

貢獻者指南