aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/format/config/option.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2020-06-24 19:34:38 +0200
committerMichael Muré <batolettre@gmail.com>2020-06-24 19:34:38 +0200
commit576e1c63c4d08fca04cf060392a8c3d8b0bba89a (patch)
treeb79bd5ee0362e5e2023f83c27f40941d84080fc4 /plumbing/format/config/option.go
parent9ac753f4afb36feb1a1c22214c16e853db54aa00 (diff)
downloadgo-git-576e1c63c4d08fca04cf060392a8c3d8b0bba89a.tar.gz
config: add missing functions for completeness
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 d4775e4..316ff52 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{}