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)
| 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. |
| 706 | func 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 | } |
no outgoing calls