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

Function transformSquashMergeOpts

pkg/cmd/repo/edit/edit.go:706–729  ·  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

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

Callers 4

NewCmdEditFunction · 0.85
interactiveRepoEditFunction · 0.85

Calls

no outgoing calls