MCPcopy Create free account
hub / github.com/cli/cli / generateCompareURL

Function generateCompareURL

pkg/cmd/pr/create/create.go:1361–1371  ·  view source on GitHub ↗
(ctx CreateContext, state shared.IssueMetadataState, projectsV1Support gh.ProjectsV1Support)

Source from the content-addressed store, hash-verified

1359}
1360
1361func generateCompareURL(ctx CreateContext, state shared.IssueMetadataState, projectsV1Support gh.ProjectsV1Support) (string, error) {
1362 u := ghrepo.GenerateRepoURL(
1363 ctx.PRRefs.BaseRepo(),
1364 "compare/%s...%s?expand=1",
1365 url.PathEscape(ctx.PRRefs.BaseRef()), url.PathEscape(ctx.PRRefs.QualifiedHeadRef()))
1366 url, err := shared.WithPrAndIssueQueryParams(ctx.Client, ctx.PRRefs.BaseRepo(), u, state, projectsV1Support)
1367 if err != nil {
1368 return "", err
1369 }
1370 return url, nil
1371}
1372
1373// Humanize returns a copy of the string s that replaces all instance of '-' and '_' with spaces.
1374func humanize(s string) string {

Callers 2

Test_generateCompareURLFunction · 0.85
createRunFunction · 0.85

Calls 5

GenerateRepoURLFunction · 0.92
BaseRepoMethod · 0.65
BaseRefMethod · 0.65
QualifiedHeadRefMethod · 0.65

Tested by 1

Test_generateCompareURLFunction · 0.68