From 88a3d8c0ac6c12a5b0fcc0ba811634c931a9dae0 Mon Sep 17 00:00:00 2001 From: ItielOlenick Date: Wed, 12 Feb 2025 10:42:12 +0200 Subject: [PATCH] fix: skip stat call when progress bar is disabled --- command/cp.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/command/cp.go b/command/cp.go index 7ed06bfee..c219003a6 100644 --- a/command/cp.go +++ b/command/cp.go @@ -521,7 +521,7 @@ func (c Copy) Run(ctx context.Context) error { srcurl := object.URL var task parallel.Task - if object.Size == 0 && !(srcurl.Type == c.dst.Type) { + if _, ok := c.progressbar.(*progressbar.CommandProgressBar); ok && object.Size == 0 && srcurl.Type != c.dst.Type { obj, err := client.Stat(ctx, srcurl) if err == nil { object.Size = obj.Size