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

Function validateSquashMergeCommitMsg

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

Source from the content-addressed store, hash-verified

695var validSquashMsgValues = []string{squashMsgDefault, squashMsgPRTitle, squashMsgPRTitleCommits, squashMsgPRTitleDescription}
696
697func 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.

Callers 2

NewCmdEditFunction · 0.85

Calls 3

FlagErrorfFunction · 0.92
ContainsMethod · 0.80
JoinMethod · 0.80

Tested by 1