Commit 0bbd1060 authored by Kyle Fuller's avatar Kyle Fuller

Revert "[pod repo list] Fixn issue showing the URL for git"

This should be in a PR.

This reverts commit 05d4076f.
parent 7c93931b
...@@ -12,9 +12,6 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -12,9 +12,6 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Boris Bügling](https://github.com/neonichu) [Boris Bügling](https://github.com/neonichu)
[#3310](https://github.com/CocoaPods/CocoaPods/issues/3310) [#3310](https://github.com/CocoaPods/CocoaPods/issues/3310)
* Fixes an issue showing the URL to remote resources in `pod repo list`.
[Kyle Fuller](https://github.com/kylef)
## 0.36.3 ## 0.36.3
......
...@@ -43,6 +43,18 @@ module Pod ...@@ -43,6 +43,18 @@ module Pod
def branch_remote_name(branch_name) def branch_remote_name(branch_name)
`git config branch.#{branch_name}.remote`.strip `git config branch.#{branch_name}.remote`.strip
end end
# Returns the url of the given remote name
# (i.e. git@github.com:CocoaPods/Specs.git).
#
# @param [#to_s] remote_name
# The branch remote name to look for the url.
#
# @return [String] The URL of the given remote.
#
def url_of_git_repo(remote_name)
`git config remote.#{remote_name}.url`.strip
end
end end
end end
end end
...@@ -38,25 +38,27 @@ module Pod ...@@ -38,25 +38,27 @@ module Pod
# Pretty-prints the source at the given path. # Pretty-prints the source at the given path.
# #
# @param [Source] source # @param [String,Pathname] path
# The source repository to be printed. # The path of the source to be printed.
# #
# @return [void] # @return [void]
# #
def print_source(source) def print_source_at_path(path)
if SourcesManager.git_repo?(source.repo) Dir.chdir(path) do
remote_name = branch_remote_name(branch_name) if SourcesManager.git_repo?(path)
if remote_name remote_name = branch_remote_name(branch_name)
UI.puts "- Type: git (#{remote_name})" if remote_name
UI.puts "- URL: #{source.url}" UI.puts "- Type: git (#{remote_name})"
url = url_of_git_repo(remote_name)
UI.puts "- URL: #{url}"
else
UI.puts '- Type: git (no remote information available)'
end
else else
UI.puts '- Type: git (no remote information available)' UI.puts '- Type: local copy'
end end
else UI.puts "- Path: #{path}"
UI.puts '- Type: local copy'
end end
UI.puts "- Path: #{source.repo}"
end end
# Pretty-prints the given sources. # Pretty-prints the given sources.
...@@ -69,7 +71,7 @@ module Pod ...@@ -69,7 +71,7 @@ module Pod
def print_sources(sources) def print_sources(sources)
sources.each do |source| sources.each do |source|
UI.title source.name do UI.title source.name do
print_source(source) print_source_at_path source.repo
end end
end end
UI.puts "\n" UI.puts "\n"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment