Skip to content

Commit

Permalink
code clean
Browse files Browse the repository at this point in the history
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
  • Loading branch information
qweeah committed Mar 4, 2023
1 parent 6db4b3f commit 6f695e5
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions cmd/oras/attach.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,26 +160,6 @@ func runAttach(opts attachOptions) error {
}
return content.Successors(ctx, fetcher, node)
}

if content.Equal(node, root) {

}
if root.MediaType == ocispec.MediaTypeArtifactManifest {
graphCopyOptions.FindSuccessors = func(ctx context.Context, fetcher content.Fetcher, node ocispec.Descriptor) ([]ocispec.Descriptor, error) {
if content.Equal(node, root) {
// skip subject
return descs, nil
}
return content.Successors(ctx, fetcher, node)
}
} else if root.MediaType == ocispec.MediaTypeImageManifest {
graphCopyOptions.FindSuccessors = func(ctx context.Context, fetcher content.Fetcher, node ocispec.Descriptor) ([]ocispec.Descriptor, error) {
if content.Equal(node, root) {
// skip subject
return append(descs,
return content.Successors(ctx, fetcher, node)
}
}
return oras.CopyGraph(ctx, store, dst, root, graphCopyOptions)
}

Expand Down

0 comments on commit 6f695e5

Please sign in to comment.