Microsoft/vscode

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

Open

#248.328 geöffnet am 21. März 2025

Auf GitHub ansehen
 (8 Kommentare) (0 Reaktionen) (1 zugewiesene Person)TypeScript (10.221 Forks)batch import
buggithelp wanted

Repository-Metriken

Stars
 (74.848 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 11h 43m) (1.000 gemergte PRs in 30 T)

Beschreibung

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.

Contributor Guide