MCPcopy Index your code
hub / github.com/cli/cli / generateCompareURL

Function generateCompareURL

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

Source from the content-addressed store, hash-verified

1280}
1281
1282func generateCompareURL(ctx CreateContext, state shared.IssueMetadataState, projectsV1Support gh.ProjectsV1Support) (string, error) {
1283 u := ghrepo.GenerateRepoURL(
1284 ctx.PRRefs.BaseRepo(),
1285 "compare/%s...%s?expand=1",
1286 url.PathEscape(ctx.PRRefs.BaseRef()), url.PathEscape(ctx.PRRefs.QualifiedHeadRef()))
1287 url, err := shared.WithPrAndIssueQueryParams(ctx.Client, ctx.PRRefs.BaseRepo(), u, state, projectsV1Support)
1288 if err != nil {
1289 return "", err
1290 }
1291 return url, nil
1292}
1293
1294// Humanize returns a copy of the string s that replaces all instance of '-' and '_' with spaces.
1295func 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