From a91448c83a7caf4434e209789885d75053493a69 Mon Sep 17 00:00:00 2001 From: Stefan Breunig Date: Mon, 11 Sep 2017 22:28:16 +0200 Subject: [PATCH] rcat: honor --dry-run even for small files --- fs/operations.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fs/operations.go b/fs/operations.go index ebfe8c049..2e5cb664b 100644 --- a/fs/operations.go +++ b/fs/operations.go @@ -1618,6 +1618,10 @@ func Rcat(fdst Fs, dstFileName string, in0 io.ReadCloser, modTime time.Time) (er in := ioutil.NopCloser(bytes.NewReader(buf[:n])) in = NewAccountSizeName(in, int64(n), dstFileName).WithBuffer() objInfo := NewStaticObjectInfo(dstFileName, modTime, int64(n), false, nil, nil) + if Config.DryRun { + Logf("stdin", "Not uploading as --dry-run") + return nil + } dst, err := fdst.Put(in, objInfo, hashOption) if err != nil { return err @@ -1646,7 +1650,7 @@ func Rcat(fdst Fs, dstFileName string, in0 io.ReadCloser, modTime time.Time) (er in = NewAccountSizeName(in, -1, dstFileName).WithBuffer() if Config.DryRun { - Logf("stdin", "Not copying as --dry-run") + Logf("stdin", "Not uploading as --dry-run") // prevents "broken pipe" errors _, err = io.Copy(ioutil.Discard, in) return err