| Index: cipd/client/cipd/common/common.go
|
| diff --git a/cipd/client/cipd/common/common.go b/cipd/client/cipd/common/common.go
|
| index 547a91f12a7f931e56a4c78b61d976a65ef1c3e0..af47970e525b360de2636343b0c745a8326ee8b6 100644
|
| --- a/cipd/client/cipd/common/common.go
|
| +++ b/cipd/client/cipd/common/common.go
|
| @@ -6,6 +6,7 @@
|
| package common
|
|
|
| import (
|
| + "errors"
|
| "fmt"
|
| "path"
|
| "regexp"
|
| @@ -249,6 +250,21 @@ func (p PinSliceBySubdir) Validate() error {
|
| return nil
|
| }
|
|
|
| +// ErrSubdirsNotYetSupported is a transitionary error which indicates that the
|
| +// invoked method does not yet work with sudbir values other than "".
|
| +var ErrSubdirsNotYetSupported = errors.New(`subdirs other than "" not currently supported`)
|
| +
|
| +// AssertOnlyDefaultSubdir is a transitionary method which returns an error if
|
| +// p contains subdirs other than "".
|
| +func (p PinSliceBySubdir) AssertOnlyDefaultSubdir() error {
|
| + if _, ok := p[""]; ok && len(p) > 1 {
|
| + return ErrSubdirsNotYetSupported
|
| + } else if !ok && len(p) > 0 {
|
| + return ErrSubdirsNotYetSupported
|
| + }
|
| + return nil
|
| +}
|
| +
|
| // ToMap converts this to a PinMapBySubdir
|
| func (p PinSliceBySubdir) ToMap() PinMapBySubdir {
|
| ret := make(PinMapBySubdir, len(p))
|
|
|