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`
[Boris Bügling](https://github.com/neonichu)
[#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
......
......@@ -43,18 +43,6 @@ module Pod
def branch_remote_name(branch_name)
`git config branch.#{branch_name}.remote`.strip
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
......@@ -38,27 +38,25 @@ module Pod
# Pretty-prints the source at the given path.
#
# @param [String,Pathname] path
# The path of the source to be printed.
# @param [Source] source
# The source repository to be printed.
#
# @return [void]
#
def print_source_at_path(path)
Dir.chdir(path) do
if SourcesManager.git_repo?(path)
def print_source(source)
if SourcesManager.git_repo?(source.repo)
remote_name = branch_remote_name(branch_name)
if remote_name
UI.puts "- Type: git (#{remote_name})"
url = url_of_git_repo(remote_name)
UI.puts "- URL: #{url}"
UI.puts "- URL: #{source.url}"
else
UI.puts '- Type: git (no remote information available)'
end
else
UI.puts '- Type: local copy'
end
UI.puts "- Path: #{path}"
end
UI.puts "- Path: #{source.repo}"
end
# Pretty-prints the given sources.
......@@ -71,7 +69,7 @@ module Pod
def print_sources(sources)
sources.each do |source|
UI.title source.name do
print_source_at_path source.repo
print_source(source)
end
end
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