MCPcopy Create free account
hub / github.com/entireio/git-sync / NormalizeProtocolMode

Function NormalizeProtocolMode

internal/validation/validation.go:87–97  ·  view source on GitHub ↗

NormalizeProtocolMode validates the configured protocol mode and applies the default auto mode when the user did not specify one.

(mode string)

Source from the content-addressed store, hash-verified

85// NormalizeProtocolMode validates the configured protocol mode and applies the
86// default auto mode when the user did not specify one.
87func NormalizeProtocolMode(mode string) (string, error) {
88 if mode == "" {
89 return ProtocolAuto, nil
90 }
91 switch mode {
92 case ProtocolAuto, ProtocolV1, ProtocolV2:
93 return mode, nil
94 default:
95 return "", fmt.Errorf("unsupported protocol mode %q", mode)
96 }
97}
98
99// ParseMapping parses a CLI --map value into a ref mapping.
100func ParseMapping(raw string) (RefMapping, error) {

Callers 7

ValidateMethod · 0.92
ValidateMethod · 0.92
ValidateMethod · 0.92
newSessionFunction · 0.92
SetMethod · 0.92
SetMethod · 0.92

Calls

no outgoing calls

Tested by 1