go-gh icon indicating copy to clipboard operation
go-gh copied to clipboard

fix: refresh repository identity after SSH translation

Open benekuehn opened this issue 4 months ago • 1 comments

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

benekuehn avatar Jul 30 '26 06:07 benekuehn

Request to merge this urgently

Quite a common usecase for users with multiple github accounts

RishabJaiswal avatar Aug 03 '26 08:08 RishabJaiswal

@williammartin any update?

benekuehn avatar Oct 06 '26 13:10 benekuehn

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

williammartin avatar Oct 07 '26 11:10 williammartin

@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.

williammartin avatar Oct 08 '26 16:10 williammartin

@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.

williammartin avatar Oct 09 '26 16:10 williammartin