| 685 | var validSquashMsgValues = []string{squashMsgDefault, squashMsgPRTitle, squashMsgPRTitleCommits, squashMsgPRTitleDescription} |
| 686 | |
| 687 | func validateSquashMergeCommitMsg(value string) error { |
| 688 | if slices.Contains(validSquashMsgValues, value) { |
| 689 | return nil |
| 690 | } |
| 691 | return cmdutil.FlagErrorf("invalid value for --squash-merge-commit-message: %q. Valid values are: %s", value, strings.Join(validSquashMsgValues, ", ")) |
| 692 | } |
| 693 | |
| 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. |