From c1bc825facd8cb404ef6c42017973c5dbe00630e Mon Sep 17 00:00:00 2001 From: Avi Drissman Date: Tue, 9 Apr 2024 19:03:25 -0400 Subject: [PATCH] Ignore unexpected file modes (#549) Ignore unexpected file modes On the Mac, git fsmonitor uses a domain socket in the .git/ folder to keep track of the fsmonitor process. cas chokes on that (see https://crbug.com/40270112). Therefore, ignore domain sockets. --- go/pkg/cas/upload.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/go/pkg/cas/upload.go b/go/pkg/cas/upload.go index 9a9f3188a..991c1c2f7 100644 --- a/go/pkg/cas/upload.go +++ b/go/pkg/cas/upload.go @@ -559,8 +559,10 @@ func (u *uploader) visitPath(ctx context.Context, absPath string, info os.FileIn node, err := u.visitRegularFile(ctx, absPath, info) return &digested{dirEntry: node, digest: node.GetDigest()}, err + // Ignore all non-expected modes (e.g. domain sockets as used by git + // fsmonitor). default: - return nil, fmt.Errorf("unexpected file mode %s", info.Mode()) + return nil, nil } }) if err != nil {