Merge pull request #17733 from Homebrew/brew-repository-more-error-checking

cmd/--repository: improve tap name error checking
This commit is contained in:
Ruoyu Zhong 2024-07-14 13:31:58 -04:00 committed by GitHub
commit 770dec760e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -13,6 +13,11 @@ tap_path() {
local repo
local part
if [[ "${tap}" != *"/"* ]]
then
odie "Invalid tap name: ${tap}"
fi
user="$(echo "${tap%%/*}" | tr '[:upper:]' '[:lower:]')"
repo="$(echo "${tap#*/}" | tr '[:upper:]' '[:lower:]')"