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