Skip to content

Commit

Permalink
minor refactor + todo
Browse files Browse the repository at this point in the history
Signed-off-by: Lixia (Sylvia) Lei <[email protected]>
  • Loading branch information
Wwwsylvia committed Nov 27, 2024
1 parent e1a23a5 commit 85b7302
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions cmd/oras/internal/option/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ const NoTTYFlag = "no-tty"
type Common struct {
Debug bool
noTTY bool

// Verbose is deprecated. Use SuppressUntitled instead.
// SuppressUntitled=false is equivalent to Verbose=true, while Verbose=false
// no longer takes effect.
// TODO: remove from common
Verbose bool

TTY *os.File
Expand Down
6 changes: 3 additions & 3 deletions internal/descriptor/descriptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ func Plain(desc ocispec.Descriptor) ocispec.Descriptor {
// GetName gets a descriptor name using either title or media type.
func GetName(desc ocispec.Descriptor) string {
title, ok := desc.Annotations[ocispec.AnnotationTitle]
if !ok {
return desc.MediaType
if ok {
return title
}
return title
return desc.MediaType
}

// GenerateContentKey generates a unique key for each content descriptor using
Expand Down

0 comments on commit 85b7302

Please sign in to comment.