Update repo normalize error message to include the name of the repo.

Signed-off-by: Chuanying Du <cydu@google.com>
This commit is contained in:
Chuanying Du 2020-10-04 18:17:37 -07:00
parent 2800ab0224
commit c26fa61ec9

View file

@ -1,7 +1,6 @@
package reference package reference
import ( import (
"errors"
"fmt" "fmt"
"strings" "strings"
@ -42,7 +41,7 @@ func ParseNormalizedNamed(s string) (Named, error) {
remoteName = remainder remoteName = remainder
} }
if strings.ToLower(remoteName) != remoteName { if strings.ToLower(remoteName) != remoteName {
return nil, errors.New("invalid reference format: repository name must be lowercase") return nil, fmt.Errorf("invalid reference format: repository name (%s) must be lowercase", remoteName)
} }
ref, err := Parse(domain + "/" + remainder) ref, err := Parse(domain + "/" + remainder)