-
Couldn't load subscription status.
- Fork 1.6k
Description
Description
Issue Summary:
GitLens incorrectly links pull requests when the commit is from a different Azure DevOps project, even though the commit tree is still visible in the current project.
Steps to Reproduce:
- A pull request (PR) is made in a different Azure DevOps project (Project B).
- The commit tree from that PR is reflected in the current project (Project A), for example via shared repositories or mirrored refs.
- GitLens correctly shows the commit in Project A because the commit exists in the tree.
- However, GitLens attempts to link the PR from that commit as if it were in Project A, which results in a broken or incorrect PR link, since the PR doesn’t exist in Project A.
Expected Behavior:
GitLens should not assume that the PR and commit exist within the same Azure DevOps project. While the commit may be valid across projects (because of shared trees), PRs are project-scoped and should be resolved accordingly.
Example:
Azure DevOps commit URL (valid):
https://dev.azure.com/<organization_name>/<correct_project_name>/_git/<repo_name>/commit/<commit_hash>
Incorrect PR link generated by GitLens:
https://dev.azure.com/<organization_name>/<current_project_name>/_git/<repo_name>/pullrequest/<pr_id>
Correct PR link (should not be generated from current project):
https://dev.azure.com/<organization_name>/<different_project_name>/_git/<repo_name>/pullrequest/<pr_id>
GitLens Version
17.0.1
VS Code Version
Version: 1.98.2 (user setup)
Commit: ddc367ed5c8936efe395cffeec279b04ffd7db78
Date: 2025-03-12T13:32:45.399Z
Electron: 34.2.0
ElectronBuildId: 11161602
Chromium: 132.0.6834.196
Node.js: 20.18.2
V8: 13.2.152.36-electron.0
OS: Windows_NT x64 10.0.26100
Git Version
git version 2.30.1
Logs, Screenshots, Screen Captures, etc
No response