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

Function ParsePushDefault

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

Source from the content-addressed store, hash-verified

516)
517
518func ParsePushDefault(s string) (PushDefault, error) {
519 validPushDefaults := map[string]struct{}{
520 string(PushDefaultNothing): {},
521 string(PushDefaultCurrent): {},
522 string(PushDefaultUpstream): {},
523 string(PushDefaultTracking): {},
524 string(PushDefaultSimple): {},
525 string(PushDefaultMatching): {},
526 }
527
528 if _, ok := validPushDefaults[s]; ok {
529 return PushDefault(s), nil
530 }
531
532 return "", fmt.Errorf("unknown push.default value: %s", s)
533}
534
535// PushDefault returns the value of push.default in the config. If the value
536// 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