diff --git a/Library/Homebrew/cmd/info.rb b/Library/Homebrew/cmd/info.rb index 00d8a5a1b9..2d6032f5e1 100644 --- a/Library/Homebrew/cmd/info.rb +++ b/Library/Homebrew/cmd/info.rb @@ -215,20 +215,14 @@ module Homebrew end def github_info(f) - if f.tap - if remote = f.tap.remote - path = if f.class.superclass == Formula - f.path.relative_path_from(f.tap.path) - elsif f.is_a?(Cask::Cask) - f.sourcefile_path.relative_path_from(f.tap.path) - end - github_remote_path(remote, path) - else - f.path - end - else - f.path + return f.path if f.tap.blank? || f.tap.remote.blank? + + path = if f.class.superclass == Formula + f.path.relative_path_from(f.tap.path) + elsif f.is_a?(Cask::Cask) + f.sourcefile_path.relative_path_from(f.tap.path) end + github_remote_path(f.tap.remote, path) end def info_formula(f, args:)