Commit 05d4076f authored by Kyle Fuller's avatar Kyle Fuller

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

parent 140c49aa
...@@ -12,6 +12,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -12,6 +12,9 @@ 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,18 +43,6 @@ module Pod ...@@ -43,18 +43,6 @@ 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,27 +38,25 @@ module Pod ...@@ -38,27 +38,25 @@ module Pod
# Pretty-prints the source at the given path. # Pretty-prints the source at the given path.
# #
# @param [String,Pathname] path # @param [Source] source
# The path of the source to be printed. # The source repository to be printed.
# #
# @return [void] # @return [void]
# #
def print_source_at_path(path) def print_source(source)
Dir.chdir(path) do if SourcesManager.git_repo?(source.repo)
if SourcesManager.git_repo?(path) remote_name = branch_remote_name(branch_name)
remote_name = branch_remote_name(branch_name) if remote_name
if remote_name UI.puts "- Type: git (#{remote_name})"
UI.puts "- Type: git (#{remote_name})" UI.puts "- URL: #{source.url}"
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: local copy' UI.puts '- Type: git (no remote information available)'
end end
UI.puts "- Path: #{path}" else
UI.puts '- Type: local copy'
end end
UI.puts "- Path: #{source.repo}"
end end
# Pretty-prints the given sources. # Pretty-prints the given sources.
...@@ -71,7 +69,7 @@ module Pod ...@@ -71,7 +69,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_at_path source.repo print_source(source)
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