Skip to content

PR integration fails to map local branch when remote URL casing differs from upstream #5494

@bradly0cjw

Description

@bradly0cjw

Describe the bug

In 0.61.0, the new pull request integration successfully fetches PR data via the gh CLI in the background (confirmed via --logs), but fails to link those PRs to local branches if the local git remote URL has a different casing than the upstream GitHub organization or user name.

Because of this case-sensitive string matching, the PR icon does not appear in the branches panel, and pressing Shift + G fails with the error: "no pull req found on this branch", even though the PR is actively open and tracked.

To Reproduce

Steps to reproduce the behavior:

  1. Clone this public repository using a lowercase remote URL:
    git clone https://github.com/ntut-npc/tattoo
  2. Navigate into the directory and checkout a branch that has an active PR:
    cd tattoo && git checkout feature/feature-flags
  3. Open Lazygit.
  4. Observe that the PR icon is missing in the local branches panel. Pressing Shift + G yields "no pull req found on this branch".
  5. Change the remote to match the uppercase API format:
    git remote set-url origin https://github.com/NTUT-NPC/tattoo
  6. Restart Lazygit and observe the PR icon instantly appears.

Expected behavior

Lazygit should perform a case-insensitive comparison when matching local remotes to the GitHub API payload. GitHub treats usernames, organization names, and repository URLs as inherently case-insensitive, so a local remote pointing to ntut-npc/tattoo should correctly map to the API payload for NTUT-NPC/tattoo.

Screenshots

Image Image

Version info:

commit=, build date=, build source=Homebrew, version=0.61.0, os=darwin, arch=arm64, git version=2.50.1 (Apple Git-155)

Terminal info:

Ghostty 1.3.1 on macOS 26.4

Additional context

When running lazygit --logs while experiencing the bug, the logs clearly show that the PRs are being successfully fetched in the background, proving the gh CLI context is working:

Apr 10 01:54:43 |INFO| git config --local --get-regexp remote\..*\.gh-resolved (7.045791ms)
Apr 10 01:54:43 |ERRO| <no msg> command="git config --local --get-regexp remote\\..*\\.gh-resolved"
Apr 10 01:54:44 |INFO| Fetched 3 PRs in 436.663916ms
...
Apr 10 01:54:45 |INFO| Fetched 3 PRs in 372.520209ms

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions