Conversation
vilmibm
left a comment
There was a problem hiding this comment.
just one nit about a function name, otherwise 👍
| return nil | ||
| } | ||
|
|
||
| func addUpstreamRemote(parentRepo ghrepo.Interface, cloneURL string) error { |
There was a problem hiding this comment.
this naming is confusing to me since it sounds like it's just talking about adding an entry with git remote add. If it's also going to clone maybe something like createUpstreamRemote would be better.
There was a problem hiding this comment.
Hmm, this function only literally adds a remote with git remote add, so I feel its name is in order. Cloning is done outside of the function, but cloneURL is passed so that the function knows how to cd into the proper git directory before executing git remote add (this is done via the -C <dir> git flag)
There was a problem hiding this comment.
i...completely misread this code
nevermind and carry on
This adds an "upstream" remote for the parent repository in addition to the "origin" remote. During an in-repo
repo forkoperation, an existing "origin" remote that previously pointed to the parent repo will now be renamed to "upstream" for consistency.Fixes #582
Followup items:
pr createas well.