From 35bcd88f08affa95bbbd4f7eca179ac58fd55318 Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Tue, 15 Mar 2022 17:09:12 -0700 Subject: [PATCH] vendor: update fsutil to 9ed61262 Signed-off-by: Tonis Tiigi (cherry picked from commit 111ea95629519085cbdc5c28e3e3c1dd1b38fc6f) --- go.mod | 1 + go.sum | 3 ++- vendor/github.com/tonistiigi/fsutil/walker.go | 20 ++++++++++++------- vendor/modules.txt | 3 ++- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index ae7061b9953..906630f2f3c 100644 --- a/go.mod +++ b/go.mod @@ -42,6 +42,7 @@ require ( github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.7.0 github.com/theupdateframework/notary v0.6.1 // indirect + github.com/tonistiigi/fsutil v0.0.0-20220315205639-9ed612626da3 // indirect github.com/zclconf/go-cty v1.10.0 go.opentelemetry.io/otel v1.4.1 go.opentelemetry.io/otel/trace v1.4.1 diff --git a/go.sum b/go.sum index dbd60e4cd7f..2752e0d073d 100644 --- a/go.sum +++ b/go.sum @@ -1286,8 +1286,9 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1 github.com/tommy-muehle/go-mnd v1.1.1/go.mod h1:dSUh0FtTP8VhvkL1S+gUR1OKd9ZnSaozuI6r3m6wOig= github.com/tommy-muehle/go-mnd v1.3.1-0.20200224220436-e6f9a994e8fa/go.mod h1:dSUh0FtTP8VhvkL1S+gUR1OKd9ZnSaozuI6r3m6wOig= github.com/tonistiigi/fsutil v0.0.0-20201103201449-0834f99b7b85/go.mod h1:a7cilN64dG941IOXfhJhlH0qB92hxJ9A1ewrdUmJ6xo= -github.com/tonistiigi/fsutil v0.0.0-20220115021204-b19f7f9cb274 h1:wbyZxD6IPFp0sl5uscMOJRsz5UKGFiNiD16e+MVfKZY= github.com/tonistiigi/fsutil v0.0.0-20220115021204-b19f7f9cb274/go.mod h1:oPAfvw32vlUJSjyDcQ3Bu0nb2ON2B+G0dtVN/SZNJiA= +github.com/tonistiigi/fsutil v0.0.0-20220315205639-9ed612626da3 h1:T1pEe+WB3SCPVAfVquvfPfagKZU2Z8c1OP3SuGB+id0= +github.com/tonistiigi/fsutil v0.0.0-20220315205639-9ed612626da3/go.mod h1:oPAfvw32vlUJSjyDcQ3Bu0nb2ON2B+G0dtVN/SZNJiA= github.com/tonistiigi/go-actions-cache v0.0.0-20211202175116-9642704158ff/go.mod h1:qqvyZqkfwkoJuPU/bw61bItaoO0SJ8YSW0vSVRRvsRg= github.com/tonistiigi/go-archvariant v1.0.0/go.mod h1:TxFmO5VS6vMq2kvs3ht04iPXtu2rUT/erOnGFYfk5Ho= github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea h1:SXhTLE6pb6eld/v/cCndK0AMpt1wiVFb/YYmqB3/QG0= diff --git a/vendor/github.com/tonistiigi/fsutil/walker.go b/vendor/github.com/tonistiigi/fsutil/walker.go index d0b5114b403..83045bec850 100644 --- a/vendor/github.com/tonistiigi/fsutil/walker.go +++ b/vendor/github.com/tonistiigi/fsutil/walker.go @@ -123,7 +123,13 @@ func Walk(ctx context.Context, p string, opt *WalkOpt, fn filepath.WalkFunc) err return nil } - var dir visitedDir + var ( + dir visitedDir + isDir bool + ) + if fi != nil { + isDir = fi.IsDir() + } if includeMatcher != nil || excludeMatcher != nil { for len(parentDirs) != 0 { @@ -134,7 +140,7 @@ func Walk(ctx context.Context, p string, opt *WalkOpt, fn filepath.WalkFunc) err parentDirs = parentDirs[:len(parentDirs)-1] } - if fi.IsDir() { + if isDir { dir = visitedDir{ fi: fi, path: path, @@ -156,12 +162,12 @@ func Walk(ctx context.Context, p string, opt *WalkOpt, fn filepath.WalkFunc) err return errors.Wrap(err, "failed to match includepatterns") } - if fi.IsDir() { + if isDir { dir.includeMatchInfo = matchInfo } if !m { - if fi.IsDir() && onlyPrefixIncludes { + if isDir && onlyPrefixIncludes { // Optimization: we can skip walking this dir if no include // patterns could match anything inside it. dirSlash := path + string(filepath.Separator) @@ -191,12 +197,12 @@ func Walk(ctx context.Context, p string, opt *WalkOpt, fn filepath.WalkFunc) err return errors.Wrap(err, "failed to match excludepatterns") } - if fi.IsDir() { + if isDir { dir.excludeMatchInfo = matchInfo } if m { - if fi.IsDir() && onlyPrefixExcludeExceptions { + if isDir && onlyPrefixExcludeExceptions { // Optimization: we can skip walking this dir if no // exceptions to exclude patterns could match anything // inside it. @@ -230,7 +236,7 @@ func Walk(ctx context.Context, p string, opt *WalkOpt, fn filepath.WalkFunc) err if includeMatcher != nil || excludeMatcher != nil { defer func() { - if fi.IsDir() { + if isDir { parentDirs = append(parentDirs, dir) } }() diff --git a/vendor/modules.txt b/vendor/modules.txt index f17568ca444..0d704693410 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -436,7 +436,8 @@ github.com/theupdateframework/notary/tuf/data github.com/theupdateframework/notary/tuf/signed github.com/theupdateframework/notary/tuf/utils github.com/theupdateframework/notary/tuf/validation -# github.com/tonistiigi/fsutil v0.0.0-20220115021204-b19f7f9cb274 +# github.com/tonistiigi/fsutil v0.0.0-20220315205639-9ed612626da3 +## explicit github.com/tonistiigi/fsutil github.com/tonistiigi/fsutil/types # github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea