MCPcopy Create free account
hub / github.com/git-bug/git-bug / RemoveAll

Method RemoveAll

repository/config_mem.go:82–91  ·  view source on GitHub ↗

RemoveAll remove all key/value pair matching the key prefix

(keyPrefix string)

Source from the content-addressed store, hash-verified

80
81// RemoveAll remove all key/value pair matching the key prefix
82func (mc *MemConfig) RemoveAll(keyPrefix string) error {
83 keyPrefix = normalizeKey(keyPrefix)
84 for key := range mc.config {
85 if strings.HasPrefix(key, keyPrefix) {
86 delete(mc.config, key)
87 }
88 }
89
90 return nil
91}
92
93func normalizeKey(key string) string {
94 // this feels so wrong, but that's apparently how git behave.

Callers

nothing calls this directly

Calls 2

normalizeKeyFunction · 0.85
HasPrefixMethod · 0.45

Tested by

no test coverage detected