MCPcopy
hub / github.com/cli/cli / transformSquashMergeOpts

Function transformSquashMergeOpts

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

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

Callers 4

NewCmdEditFunction · 0.85
interactiveRepoEditFunction · 0.85

Calls

no outgoing calls