refactor: remove github.com/pkg/errors dependency (#1077)

* refactor: split out common/git

* refactor: move git options to separate func

* refactor: remove github.com/pkg/errors dependency

* fix(golangci-lint): forbid github.com/pkg/errors

* style: fix typo

* style: fix typo

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
R
2022-06-10 23:16:42 +02:00
committed by GitHub
parent 8a473943c3
commit 2aa0699aec
13 changed files with 134 additions and 98 deletions

View File

@@ -15,7 +15,6 @@ import (
"github.com/go-git/go-git/v5/plumbing/filemode"
"github.com/go-git/go-git/v5/plumbing/format/gitignore"
"github.com/go-git/go-git/v5/plumbing/format/index"
"github.com/pkg/errors"
)
type fileCollectorHandler interface {
@@ -151,7 +150,7 @@ func (fc *fileCollector) collectFiles(ctx context.Context, submodulePath []strin
if fi.Mode()&os.ModeSymlink == os.ModeSymlink {
linkName, err := fc.Fs.Readlink(file)
if err != nil {
return errors.WithMessagef(err, "unable to readlink %s", file)
return fmt.Errorf("unable to readlink '%s': %w", file, err)
}
return fc.Handler.WriteFile(path, fi, linkName, nil)
} else if !fi.Mode().IsRegular() {