-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Add --upstream-remote-name flag to gh replo clone #5619
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ahmedadan Thanks for the contribution and patients while we got this reviewed. The code looks good to me. I pushed a small change that clarified some of the help documentation, added a test, and did a small refactor of AddUpstreamRemote
to make it more generalized which allowed me to simplify the overall logic a bit.
@mislav What do you think of the @owner
functionality introduced here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks for adding this feature
@@ -367,12 +367,12 @@ func RunClone(cloneURL string, args []string) (target string, err error) { | |||
return | |||
} | |||
|
|||
func AddUpstreamRemote(upstreamURL, cloneDir string, branches []string) error { | |||
args := []string{"-C", cloneDir, "remote", "add"} | |||
func AddNamedRemote(url, name, dir string, branches []string) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This now has large overlap with the existing git.AddRemote()
function, but it's fine for now as we can clean that up as part of #4900
Fixes #5467
First take on the issue here, also newer to Go and the project so any guidance would be greatly appreciated.
--upstream-remote-name
flag@owner
decorator