Skip to content

Commit

Permalink
Simplify Tap#remote_repo.
Browse files Browse the repository at this point in the history
  • Loading branch information
reitermarkus committed Feb 29, 2024
1 parent 977ac20 commit e047dee
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Library/Homebrew/tap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,9 @@ def remote
# The remote repository name of this {Tap}.
# e.g. `user/homebrew-repo`
def remote_repo
return unless remote

@remote_repo ||= remote.delete_prefix("https://github.com/")
.delete_prefix("[email protected]:")
.delete_suffix(".git")
@remote_repo ||= remote&.delete_prefix("https://github.com/")
&.delete_prefix("[email protected]:")
&.delete_suffix(".git")
end

# The default remote path to this {Tap}.
Expand Down

0 comments on commit e047dee

Please sign in to comment.