MCPcopy
hub / github.com/cli/cli / ParsePushDefault

Function ParsePushDefault

git/client.go:456–471  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

454)
455
456func ParsePushDefault(s string) (PushDefault, error) {
457 validPushDefaults := map[string]struct{}{
458 string(PushDefaultNothing): {},
459 string(PushDefaultCurrent): {},
460 string(PushDefaultUpstream): {},
461 string(PushDefaultTracking): {},
462 string(PushDefaultSimple): {},
463 string(PushDefaultMatching): {},
464 }
465
466 if _, ok := validPushDefaults[s]; ok {
467 return PushDefault(s), nil
468 }
469
470 return "", fmt.Errorf("unknown push.default value: %s", s)
471}
472
473// PushDefault returns the value of push.default in the config. If the value
474// is not set, it returns "simple" (the default git value). See

Callers 2

TestPushDefaultFunction · 0.85
PushDefaultMethod · 0.85

Calls 2

PushDefaultTypeAlias · 0.85
ErrorfMethod · 0.65

Tested by 1

TestPushDefaultFunction · 0.68