From 72f1343612d327d2201ef9a064458c3a7dfbeb6c Mon Sep 17 00:00:00 2001 From: SIGSEGV Date: Wed, 21 Apr 2021 14:35:54 +0800 Subject: [PATCH] Fix the issue that clone will add yanked component (#1321) --- cmd/mirror.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/mirror.go b/cmd/mirror.go index 4b668ba3b5..ea5e567ccf 100644 --- a/cmd/mirror.go +++ b/cmd/mirror.go @@ -792,12 +792,14 @@ func newMirrorCloneCmd() *cobra.Command { } if index != nil && len(index.Components) > 0 { - for name := range index.Components { + for name, comp := range index.Components { + if comp.Yanked { + continue + } components = append(components, name) } } sort.Strings(components) - for _, name := range components { options.Components[name] = new([]string) cmd.Flags().StringSliceVar(options.Components[name], name, nil, "Specify the versions for component "+name)