diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2015-11-17 07:50:32 +0100 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2015-11-17 07:50:32 +0100 |
commit | 491de646e625801d2f809ed4a99c7ace019a3f15 (patch) | |
tree | 8a5ff1e0425a1da8ca8fd4875ba20227961d228b /clients/common/common.go | |
parent | 49f40d9f410a6fc0a9c89ba228d16cd570ec711a (diff) | |
download | go-git-491de646e625801d2f809ed4a99c7ace019a3f15.tar.gz |
client/common: fix empty panic on set at empty capability
Diffstat (limited to 'clients/common/common.go')
-rw-r--r-- | clients/common/common.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clients/common/common.go b/clients/common/common.go index ef35440..a6f6166 100644 --- a/clients/common/common.go +++ b/clients/common/common.go @@ -99,7 +99,10 @@ func (c *Capabilities) Get(capability string) *Capability { // Set sets a capability removing the values func (c *Capabilities) Set(capability string, values ...string) { - delete(c.m, capability) + if _, ok := c.m[capability]; ok { + delete(c.m, capability) + } + c.Add(capability, values...) } |