Fetch upstream remote after adding it#752
Conversation
| cloneDir := path.Base(strings.TrimSuffix(cloneURL, ".git")) | ||
|
|
||
| cloneCmd := git.GitCommand("-C", cloneDir, "remote", "add", "upstream", upstreamURL) | ||
| cloneCmd := git.GitCommand("-C", cloneDir, "remote", "add", "-f", "upstream", upstreamURL) |
There was a problem hiding this comment.
I was wondering if it might be possible – and preferred – to instead repurpose and use an adjusted version of AddRemote:
Lines 74 to 76 in e10ccef
There was a problem hiding this comment.
That is generally a good idea, but in this instance it would require us to change the signature of AddRemote to accept an additional (optional) directory parameter.
Since making that change isn't a marked improvement over your current approach, in my book, I would just say— this looks good, and leave it as is! Thank you so much for taking a stab at a fix 🎉
| cloneDir := path.Base(strings.TrimSuffix(cloneURL, ".git")) | ||
|
|
||
| cloneCmd := git.GitCommand("-C", cloneDir, "remote", "add", "upstream", upstreamURL) | ||
| cloneCmd := git.GitCommand("-C", cloneDir, "remote", "add", "-f", "upstream", upstreamURL) |
There was a problem hiding this comment.
That is generally a good idea, but in this instance it would require us to change the signature of AddRemote to accept an additional (optional) directory parameter.
Since making that change isn't a marked improvement over your current approach, in my book, I would just say— this looks good, and leave it as is! Thank you so much for taking a stab at a fix 🎉
This is a naive proposal for fixing #731