Microsoft/vscode

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

Open

#248.328 aperta il 21 mar 2025

Vedi su GitHub
 (8 commenti) (0 reazioni) (1 assegnatario)TypeScript (10.221 fork)batch import
buggithelp wanted

Metriche repository

Star
 (74.848 star)
Metriche merge PR
 (Merge medio 11h 43m) (1000 PR mergiate in 30 g)

Descrizione

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.

Guida contributor