docs(pr create): standard <user>:<branch> syntax
Standardize <user>:<branch> syntax wherever it is described in comments.
This commit is contained in:
parent
6dae35b442
commit
041f02c980
3 changed files with 4 additions and 4 deletions
|
|
@ -599,7 +599,7 @@ func NewCreateContext(opts *CreateOptions) (*CreateContext, error) {
|
|||
promptForHeadRepo = false
|
||||
targetHeadBranch = opts.HeadBranch
|
||||
// If the --head provided contains a colon, that means
|
||||
// this is <owner>:<branch> syntax.
|
||||
// this is <user>:<branch> syntax.
|
||||
if idx := strings.IndexRune(opts.HeadBranch, ':'); idx >= 0 {
|
||||
targetHeadRepoOwner = opts.HeadBranch[:idx]
|
||||
targetHeadBranch = opts.HeadBranch[idx+1:]
|
||||
|
|
@ -636,7 +636,7 @@ func NewCreateContext(opts *CreateOptions) (*CreateContext, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
// If the --head provided contains <repo_name>:<branch> syntax, we need to use
|
||||
// If the --head provided contains <user>:<branch> syntax, we need to use
|
||||
// the provided owner instead of the owner of the base repository.
|
||||
if targetHeadRepoOwner != "" {
|
||||
prRefs.HeadRepo = ghrepo.New(targetHeadRepoOwner, prRefs.HeadRepo.RepoName())
|
||||
|
|
|
|||
|
|
@ -1547,7 +1547,7 @@ func Test_createRun(t *testing.T) {
|
|||
expectedErrOut: "\nCreating pull request for monalisa:task1 into feature/feat2 in OWNER/REPO\n\n",
|
||||
},
|
||||
{
|
||||
name: "--head contains <remote>:<branch> syntax",
|
||||
name: "--head contains <user>:<branch> syntax",
|
||||
httpStubs: func(reg *httpmock.Registry, t *testing.T) {
|
||||
reg.Register(
|
||||
httpmock.GraphQL(`mutation PullRequestCreate\b`),
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ func (s *PullRequestRefs) HasHead() bool {
|
|||
|
||||
// GetPRHeadLabel returns the string that the GitHub API uses to identify the PR. This is
|
||||
// either just the branch name or, if the PR is originating from a fork, the fork owner
|
||||
// and the branch name, like <owner>:<branch>.
|
||||
// and the branch name, like <user>:<branch>.
|
||||
func (s *PullRequestRefs) GetPRHeadLabel() string {
|
||||
if ghrepo.IsSame(s.HeadRepo, s.BaseRepo) {
|
||||
return s.BranchName
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue