Skip to content

fix: open commit URL against selected remote#5357

Open
SergioChan wants to merge 1 commit intojesseduffield:masterfrom
SergioChan:fix/open-commit-selected-remote
Open

fix: open commit URL against selected remote#5357
SergioChan wants to merge 1 commit intojesseduffield:masterfrom
SergioChan:fix/open-commit-selected-remote

Conversation

@SergioChan
Copy link

Summary

  • stop hardcoding origin when building hosting-service URLs for commit links
  • prefer the selected remote branch's remote name, then selected remote name, then fallback to origin
  • keep a fallback to origin URL resolution if the selected remote lookup fails
  • add focused unit tests for remote selection precedence

Why

When browsing commits from a non-origin remote in the Remotes/Remote Branches flow, pressing o should open the selected remote host, not always the first remote.

Fixes #5260

Testing

  • go test ./pkg/gui/controllers/helpers -run TestGetPreferredRemoteName

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

With multiple remotes, 'open commit in browser' always open in first remote

1 participant