File tree Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,14 @@ func createAction(context *cli.Context) error {
5252 return fmt .Errorf ("ref must be provided" )
5353 }
5454
55+ for index , ref := range v .refs {
56+ for i := index + 1 ; i < len (v .refs ); i ++ {
57+ if ref == v .refs [i ] {
58+ fmt .Printf ("WARNING: refs contains duplicate reference %q.\n " , v .refs [i ])
59+ }
60+ }
61+ }
62+
5563 if v .typ == "" {
5664 typ , err := image .Autodetect (context .Args ()[0 ])
5765 if err != nil {
Original file line number Diff line number Diff line change @@ -50,6 +50,14 @@ func unpackAction(context *cli.Context) error {
5050 return fmt .Errorf ("ref must be provided" )
5151 }
5252
53+ for index , ref := range v .refs {
54+ for i := index + 1 ; i < len (v .refs ); i ++ {
55+ if ref == v .refs [i ] {
56+ fmt .Printf ("WARNING: refs contains duplicate reference %q.\n " , v .refs [i ])
57+ }
58+ }
59+ }
60+
5361 if v .typ == "" {
5462 typ , err := image .Autodetect (context .Args ()[0 ])
5563 if err != nil {
Original file line number Diff line number Diff line change @@ -54,6 +54,14 @@ func validateAction(context *cli.Context) error {
5454 refs : context .StringSlice ("ref" ),
5555 }
5656
57+ for index , ref := range v .refs {
58+ for i := index + 1 ; i < len (v .refs ); i ++ {
59+ if ref == v .refs [i ] {
60+ fmt .Printf ("WARNING: refs contains duplicate reference %q.\n " , v .refs [i ])
61+ }
62+ }
63+ }
64+
5765 var errs []string
5866 for _ , arg := range context .Args () {
5967 err := validatePath (arg )
You can’t perform that action at this time.
0 commit comments