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