aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/format/config/option.go
diff options
context:
space:
mode:
Diffstat (limited to 'plumbing/format/config/option.go')
-rw-r--r--plumbing/format/config/option.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/plumbing/format/config/option.go b/plumbing/format/config/option.go
index 218f992..cad3948 100644
--- a/plumbing/format/config/option.go
+++ b/plumbing/format/config/option.go
@@ -54,6 +54,16 @@ func (opts Options) Get(key string) string {
return ""
}
+// Has checks if an Option exist with the given key.
+func (opts Options) Has(key string) bool {
+ for _, o := range opts {
+ if o.IsKey(key) {
+ return true
+ }
+ }
+ return false
+}
+
// GetAll returns all possible values for the same key.
func (opts Options) GetAll(key string) []string {
result := []string{}