Skip to content

[Bug]: PR lookup misses renamed origin when GH_REPO uses the current name #45976

Done

Description

@STiFLeR7

Before submitting

Area

apps/server

Steps to reproduce

  1. Use a branch that tracks origin and already has a same-repository PR. Keep the remote URL on the repository's old name after a rename.
  2. Start T3 Code with GH_REPO set to the repository's current name.
  3. Look up the branch PR. The Version Control section uses the GitManager.branchPullRequest path.

The public fixture is PR #45948 on factory/issue-45859, with origin on https://github.com/pingdotgg/t3-code.git and GH_REPO=pingdotgg/t3code. GitHub returns repository ID 1153130349 for both names and marks #45948 as same-repository.

Expected behavior

The branch lookup returns its existing PR because the tracked remote and the selected target resolve to the same repository.

Actual behavior

GitManager.branchPullRequest returned null with the canonical override. The old remote without the override returned #45948 after #45951. Using the current name for both the remote and override also returned #45948. An override targeting a genuinely different repository under the same owner was correctly rejected.

I reproduced this through the real service with local Git and fixture PR data, and checked the target decision separately through the GitHub provider. createsChangeRequestsIn compares the configured slugs, so the alias pair gets classified as cross-repository. The matcher then rejects the same-repository PR. The review thread has the comparison. I did not create a live PR or drive the desktop UI.

Impact

Minor bug or occasional failure. The existing PR is missing from T3 Code's branch lookup for this configuration.

Version and environment

Windows, Node 26.13.1. The tested #45951 revision was 684c8682. GitHub reports identical blobs for the Git manager and GitHub provider on main at 1002f254d2.

Workaround

Use the current repository name for origin, or unset GH_REPO when the checkout already identifies the intended target.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions