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

Function transformSquashMergeOpts

pkg/cmd/repo/edit/edit.go:703–726  ·  view source on GitHub ↗

transformSquashMergeOpts maps the user-facing squash merge commit message option to the two API fields: squash_merge_commit_title and squash_merge_commit_message.

(edits *EditRepositoryInput)

Source from the content-addressed store, hash-verified

701// transformSquashMergeOpts maps the user-facing squash merge commit message option
702// to the two API fields: squash_merge_commit_title and squash_merge_commit_message.
703func transformSquashMergeOpts(edits *EditRepositoryInput) {
704 if edits.squashMergeCommitMsg == nil {
705 return
706 }
707 var title, message string
708 switch *edits.squashMergeCommitMsg {
709 case squashMsgDefault:
710 title = "COMMIT_OR_PR_TITLE"
711 message = "COMMIT_MESSAGES"
712 case squashMsgPRTitle:
713 title = "PR_TITLE"
714 message = "BLANK"
715 case squashMsgPRTitleCommits:
716 title = "PR_TITLE"
717 message = "COMMIT_MESSAGES"
718 case squashMsgPRTitleDescription:
719 title = "PR_TITLE"
720 message = "PR_BODY"
721 default:
722 return
723 }
724 edits.SquashMergeCommitTitle = &title
725 edits.SquashMergeCommitMessage = &message
726}

Callers 4

NewCmdEditFunction · 0.85
interactiveRepoEditFunction · 0.85

Calls

no outgoing calls