| 695 | var validSquashMsgValues = []string{squashMsgDefault, squashMsgPRTitle, squashMsgPRTitleCommits, squashMsgPRTitleDescription} |
| 696 | |
| 697 | func validateSquashMergeCommitMsg(value string) error { |
| 698 | if slices.Contains(validSquashMsgValues, value) { |
| 699 | return nil |
| 700 | } |
| 701 | return cmdutil.FlagErrorf("invalid value for --squash-merge-commit-message: %q. Valid values are: %s", value, strings.Join(validSquashMsgValues, ", ")) |
| 702 | } |
| 703 | |
| 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. |