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

Function transformSquashMergeOpts

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

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

Callers 4

NewCmdEditFunction · 0.85
interactiveRepoEditFunction · 0.85

Calls

no outgoing calls