From a20c92681d259684c5a27af8e20c21520c11bf39 Mon Sep 17 00:00:00 2001 From: Xiaoxuan Wang Date: Tue, 10 Dec 2024 10:41:55 +0800 Subject: [PATCH] changed fetch output of index create Signed-off-by: Xiaoxuan Wang --- cmd/oras/internal/display/status/text.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/oras/internal/display/status/text.go b/cmd/oras/internal/display/status/text.go index 618f93725..cf107f7f4 100644 --- a/cmd/oras/internal/display/status/text.go +++ b/cmd/oras/internal/display/status/text.go @@ -212,8 +212,11 @@ func (mich *TextManifestIndexCreateHandler) OnFetching(source string) error { } // OnFetched implements ManifestIndexCreateHandler. -func (mich *TextManifestIndexCreateHandler) OnFetched(source string, _ ocispec.Descriptor) error { - return mich.printer.Println(IndexPromptFetched, source) +func (mich *TextManifestIndexCreateHandler) OnFetched(ref string, desc ocispec.Descriptor) error { + if contentutil.IsDigest(ref) { + return mich.printer.Println(IndexPromptFetched, ref) + } + return mich.printer.Println(IndexPromptFetched, desc.Digest, ref) } // OnIndexPacked implements ManifestIndexCreateHandler.