"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "pkg/cmd/pr/shared/params.go" between
gh-cli-1.11.0.tar.gz and gh-cli-1.12.0.tar.gz

About: GitHub CLI is GitHub’s official command line tool.

params.go  (gh-cli-1.11.0):params.go  (gh-cli-1.12.0)
package shared package shared
import ( import (
"fmt" "fmt"
"github.com/google/shlex"
"net/url" "net/url"
"strings" "strings"
"github.com/cli/cli/api" "github.com/cli/cli/api"
"github.com/cli/cli/internal/ghrepo" "github.com/cli/cli/internal/ghrepo"
"github.com/cli/cli/pkg/githubsearch" "github.com/cli/cli/pkg/githubsearch"
"github.com/google/shlex"
) )
func WithPrAndIssueQueryParams(client *api.Client, baseRepo ghrepo.Interface, ba seURL string, state IssueMetadataState) (string, error) { func WithPrAndIssueQueryParams(client *api.Client, baseRepo ghrepo.Interface, ba seURL string, state IssueMetadataState) (string, error) {
u, err := url.Parse(baseURL) u, err := url.Parse(baseURL)
if err != nil { if err != nil {
return "", err return "", err
} }
q := u.Query() q := u.Query()
if state.Title != "" { if state.Title != "" {
q.Set("title", state.Title) q.Set("title", state.Title)
} }
if state.Body != "" { // We always want to send the body parameter, even if it's empty, to prev
q.Set("body", state.Body) ent the web interface from
} // applying the default template. Since the user has the option to select
a template in the terminal,
// assume that empty body here means that the user either skipped it or e
rased its contents.
q.Set("body", state.Body)
if len(state.Assignees) > 0 { if len(state.Assignees) > 0 {
q.Set("assignees", strings.Join(state.Assignees, ",")) q.Set("assignees", strings.Join(state.Assignees, ","))
} }
if len(state.Labels) > 0 { if len(state.Labels) > 0 {
q.Set("labels", strings.Join(state.Labels, ",")) q.Set("labels", strings.Join(state.Labels, ","))
} }
if len(state.Projects) > 0 { if len(state.Projects) > 0 {
projectPaths, err := api.ProjectNamesToPaths(client, baseRepo, st ate.Projects) projectPaths, err := api.ProjectNamesToPaths(client, baseRepo, st ate.Projects)
if err != nil { if err != nil {
return "", fmt.Errorf("could not add to project: %w", err ) return "", fmt.Errorf("could not add to project: %w", err )
 End of changes. 3 change blocks. 
4 lines changed or deleted 8 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)