return err == fs.ErrNotExist
}
-// ErrUnsupported indicates that a requested operation cannot be performed,
-// because it is unsupported. This error indicates that there is no alternative
-// way to perform the operation.
-//
-// TODO(#41198): Remove this declaration and use errors.ErrUnsupported instead.
-var ErrUnsupported = unsupportedOperationError{}
-
-type unsupportedOperationError struct{}
-
-func (unsupportedOperationError) Error() string {
- return "unsupported operation"
-}
-
// AllHex reports whether the revision rev is entirely lower-case hexadecimal digits.
func AllHex(rev string) bool {
for i := 0; i < len(rev); i++ {
}
func (r *vcsRepo) CheckReuse(old *Origin, subdir string) error {
- return fmt.Errorf("vcs %s: CheckReuse: %w", r.cmd.vcs, ErrUnsupported)
+ return fmt.Errorf("vcs %s: CheckReuse: %w", r.cmd.vcs, errors.ErrUnsupported)
}
func (r *vcsRepo) Tags(prefix string) (*Tags, error) {
}
defer unlock()
- return "", vcsErrorf("vcs %s: RecentTag: %w", r.cmd.vcs, ErrUnsupported)
+ return "", vcsErrorf("vcs %s: RecentTag: %w", r.cmd.vcs, errors.ErrUnsupported)
}
func (r *vcsRepo) DescendsFrom(rev, tag string) (bool, error) {
}
defer unlock()
- return false, vcsErrorf("vcs %s: DescendsFrom: %w", r.cmd.vcs, ErrUnsupported)
+ return false, vcsErrorf("vcs %s: DescendsFrom: %w", r.cmd.vcs, errors.ErrUnsupported)
}
func (r *vcsRepo) ReadZip(rev, subdir string, maxSize int64) (zip io.ReadCloser, err error) {
if r.cmd.readZip == nil && r.cmd.doReadZip == nil {
- return nil, vcsErrorf("vcs %s: ReadZip: %w", r.cmd.vcs, ErrUnsupported)
+ return nil, vcsErrorf("vcs %s: ReadZip: %w", r.cmd.vcs, errors.ErrUnsupported)
}
unlock, err := r.mu.Lock()
}
if pseudoBase == "" {
tag, err := r.code.RecentTag(info.Name, tagPrefix, tagAllowed)
- if err != nil && !errors.Is(err, codehost.ErrUnsupported) {
+ if err != nil && !errors.Is(err, errors.ErrUnsupported) {
return nil, err
}
if tag != "" {