fix: refresh repository identity after SSH translation
Summary
- refresh cached remote metadata after resolving SSH host aliases
- preserve fetch URL precedence, falling back to push metadata when the fetch URL cannot be parsed
Root cause
repository.Current translated the fetch and push URLs, but the cached Host, Owner, and Repo fields still described the pre-translation URL. Known-host filtering therefore rejected remotes that used SSH aliases for GitHub.
Testing
go test ./...go vet ./...
Related issues
- Relates to github/gh-stack#45
- Relates to github/gh-stack#337
Request to merge this urgently
Quite a common usecase for users with multiple github accounts
@williammartin any update?
Hey @benekuehn, sorry, let me take a look today. I also just stumbled across your comment on https://github.com/github/gh-stack/issues/45
@benekuehn I made some more changes here so I've requested a review from @babakks. Hopefully we can get this released and then into a gh-stack release tomorrow.
@benekuehn merged, released, merged into gh-stack and released: https://github.com/github/gh-stack/releases/tag/v0.2.1
Hopefully works for you. Thanks for your help.