diff options
| author | Rose Hogenson <rosehogenson@posteo.net> | 2025-04-12 08:04:41 -0700 |
|---|---|---|
| committer | Rose Hogenson <rosehogenson@posteo.net> | 2025-04-12 08:04:41 -0700 |
| commit | b1dc6e107226af60b5fb11400b9739889e498994 (patch) | |
| tree | 428d5cd82fa472cf03757f8d3337f13f3619749c /internal/cp/cp.go | |
| parent | Fix a few path.Join to filepath.Join for local paths (diff) | |
| download | ccp-b1dc6e107226af60b5fb11400b9739889e498994.tar.zst | |
Avoid error spam for recursive copies
If we fail to create a parent directory, there's no need to try and copy
the contents.
Diffstat (limited to 'internal/cp/cp.go')
| -rw-r--r-- | internal/cp/cp.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/cp/cp.go b/internal/cp/cp.go index 66313c7..58350df 100644 --- a/internal/cp/cp.go +++ b/internal/cp/cp.go @@ -260,7 +260,7 @@ func Copy(progress Progress, srcs []FSPath, dstRoot FSPath, force bool) { stat, err := d.Info() if err != nil { progress.FileDone(src.String(), err) - return nil + return fs.SkipDir } hasWritePerm := stat.Mode()&0300 == 0300 if err := c.openWithRetry(dst, func() error { @@ -280,7 +280,7 @@ func Copy(progress Progress, srcs []FSPath, dstRoot FSPath, force bool) { } }); err != nil { progress.FileDone(src.String(), err) - return nil + return fs.SkipDir } if hasWritePerm { progress.Progress(1) |
