MCPcopy Create free account
hub / github.com/cli/cli / validateSquashMergeCommitMsg

Function validateSquashMergeCommitMsg

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

Source from the content-addressed store, hash-verified

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

Callers 2

NewCmdEditFunction · 0.85

Calls 3

FlagErrorfFunction · 0.92
ContainsMethod · 0.80
JoinMethod · 0.80

Tested by 1