Conversation
23ba4cc to
3b109cd
Compare
this adds recognition of the git_protocol setting when: - creating a repo - cloning a repo - forking a repo - forking/pushing during pr create - checking out a PR additionally, it: - consolidates remote adding to use AddRemote; this introduces a fetch where there previously hadn't been one - changes repo clone to accept an ssh url - changes repo fork to accept an ssh url i just added basic unit tests; adding new test cases for all of the above scenarios seemed like diminishing returns.
6255ccc to
bec58ed
Compare
probablycorey
approved these changes
Apr 22, 2020
Contributor
probablycorey
left a comment
There was a problem hiding this comment.
This looks great 😎
| baseRemote, _ := remotes.FindByRepo(baseRepo.RepoOwner(), baseRepo.RepoName()) | ||
| // baseRemoteSpec is a repository URL or a remote name to be used in git fetch | ||
| baseURLOrName := fmt.Sprintf("https://github.com/%s.git", ghrepo.FullName(baseRepo)) | ||
| baseURLOrName := formatRemoteURL(cmd, ghrepo.FullName(baseRepo)) |
| remoteAdd.Stdout = os.Stdout | ||
| remoteAdd.Stderr = os.Stderr | ||
| err = run.PrepareCmd(remoteAdd).Run() | ||
| _, err = git.AddRemote("origin", remoteURL) |
Contributor
There was a problem hiding this comment.
👍👍this is easier to understand now
command/repo.go
Outdated
| if err != nil { | ||
| return fmt.Errorf("did not understand argument: %w", err) | ||
| } | ||
| toFork, err = ghrepo.FromURL(parsedURL) |
Contributor
There was a problem hiding this comment.
You didn't introduce the toFork var in this PR. But naming it to repoToFork might make this easier to read. I was thrown off by what toFork did.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #546
this adds recognition of the
git_protocolsetting when:additionally, it:
where there previously hadn't been one
i just added basic unit tests; adding new test cases for all of the
above scenarios seemed like diminishing returns.