MCPcopy
hub / github.com/cli/cli / validateSquashMergeCommitMsg

Function validateSquashMergeCommitMsg

pkg/cmd/repo/edit/edit.go:687–692  ·  view source on GitHub ↗
(value string)

Source from the content-addressed store, hash-verified

685var validSquashMsgValues = []string{squashMsgDefault, squashMsgPRTitle, squashMsgPRTitleCommits, squashMsgPRTitleDescription}
686
687func 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.

Callers 2

NewCmdEditFunction · 0.85

Calls 3

FlagErrorfFunction · 0.92
ContainsMethod · 0.80
JoinMethod · 0.80

Tested by 1