fix(cache): update error message for missing cache key with --ref flag

* Changed the error message from "--ref cannot be used without cache key/ID" to "must provide a cache key" for clarity.
* Updated corresponding test case to reflect the new error message.
This commit is contained in:
Lucas 2025-08-26 21:31:09 +02:00
parent 3ba82b58a9
commit 047326fcb4
No known key found for this signature in database
2 changed files with 2 additions and 2 deletions

View file

@ -88,7 +88,7 @@ func NewCmdDelete(f *cmdutil.Factory, runF func(*DeleteOptions) error) *cobra.Co
}
if opts.Ref != "" && len(args) == 0 {
return cmdutil.FlagErrorf("--ref cannot be used without cache key/ID")
return cmdutil.FlagErrorf("must provide a cache key")
}
if !opts.DeleteAll && len(args) == 0 {

View file

@ -71,7 +71,7 @@ func TestNewCmdDelete(t *testing.T) {
{
name: "ref flag without cache key",
cli: "--ref refs/heads/main",
wantsErr: "--ref cannot be used without cache key/ID",
wantsErr: "must provide a cache key",
},
{
name: "ref flag with all flag",