Microsoft/vscode

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

Open

#248.328 aberto em 21 de mar. de 2025

Ver no GitHub
 (8 comments) (0 reactions) (1 assignee)TypeScript (10.221 forks)batch import
buggithelp wanted

Métricas do repositório

Stars
 (74.848 stars)
Métricas de merge de PR
 (Mesclagem média 11h 43m) (1.000 fundiu PRs em 30d)

Description

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.

Guia do colaborador