From 3072b1be8cf7c87aac1e7832c982b03f7142bcd6 Mon Sep 17 00:00:00 2001 From: Wei Meng Date: Wed, 20 Jul 2022 12:48:59 +0800 Subject: [PATCH] Apply suggestions from code review Signed-off-by: Wei Meng --- copy.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/copy.go b/copy.go index 98af7b81..5ebf5924 100644 --- a/copy.go +++ b/copy.go @@ -352,12 +352,11 @@ func prepareCopy(ctx context.Context, dst Target, dstRef string, proxy *cas.Prox if !descriptor.EqualOCI(desc, root) { return nil } - // copy reference for skipped root + // enforce tagging when root manifest is skipped if refPusher, ok := dst.(registry.ReferencePusher); ok { return copyCachedNodeWithReference(ctx, proxy, refPusher, desc, dstRef) - } else { - return dst.Tag(ctx, root, dstRef) } + return dst.Tag(ctx, root, dstRef) } return nil