dev-cmd/bump-formula-pr: always use full git repo as tap remote
This commit is contained in:
parent
58b03edb94
commit
02cef968a2
@ -129,7 +129,7 @@ module Homebrew
|
|||||||
# spamming during normal output.
|
# spamming during normal output.
|
||||||
Homebrew.install_bundler_gems!(groups: ["audit", "style"]) unless args.no_audit?
|
Homebrew.install_bundler_gems!(groups: ["audit", "style"]) unless args.no_audit?
|
||||||
|
|
||||||
tap_remote_repo = formula.tap.full_name || formula.tap.remote_repository
|
tap_remote_repo = formula.tap.remote_repository
|
||||||
remote = "origin"
|
remote = "origin"
|
||||||
remote_branch = formula.tap.git_repository.origin_branch_name
|
remote_branch = formula.tap.git_repository.origin_branch_name
|
||||||
previous_branch = "-"
|
previous_branch = "-"
|
||||||
|
@ -275,10 +275,9 @@ class Tap
|
|||||||
sig { returns(T.nilable(String)) }
|
sig { returns(T.nilable(String)) }
|
||||||
def remote_repository
|
def remote_repository
|
||||||
return unless (remote = self.remote)
|
return unless (remote = self.remote)
|
||||||
|
return unless (match = remote.match(HOMEBREW_TAP_REPOSITORY_REGEX))
|
||||||
|
|
||||||
@remote_repository ||= remote.delete_prefix("https://github.com/")
|
@remote_repository ||= T.must(match[:remote_repository])
|
||||||
.delete_prefix("git@github.com:")
|
|
||||||
.delete_suffix(".git")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# @deprecated
|
# @deprecated
|
||||||
|
@ -13,6 +13,11 @@ HOMEBREW_DEFAULT_TAP_FORMULA_REGEX = T.let(
|
|||||||
%r{\A(?:[Hh]omebrew/(?:homebrew-)?core/)?(?<name>#{HOMEBREW_TAP_FORMULA_NAME_REGEX.source})\Z},
|
%r{\A(?:[Hh]omebrew/(?:homebrew-)?core/)?(?<name>#{HOMEBREW_TAP_FORMULA_NAME_REGEX.source})\Z},
|
||||||
Regexp,
|
Regexp,
|
||||||
)
|
)
|
||||||
|
# Match taps' remote repository, e.g. `someuser/somerepo`.
|
||||||
|
HOMEBREW_TAP_REPOSITORY_REGEX = T.let(
|
||||||
|
%r{\A.+[/:](?<remote_repository>[^/:]+/[^/:]+?(?=\.git/*\Z|/*\Z))},
|
||||||
|
Regexp,
|
||||||
|
)
|
||||||
|
|
||||||
# Match a cask token.
|
# Match a cask token.
|
||||||
HOMEBREW_TAP_CASK_TOKEN_REGEX = T.let(/(?<token>[\w+\-.@]+)/, Regexp)
|
HOMEBREW_TAP_CASK_TOKEN_REGEX = T.let(/(?<token>[\w+\-.@]+)/, Regexp)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user