[Repo::Add] Add --progress option to show git progress

Git added a `--progress` option in 1.7.0 (earliest tag containing
https://github.com/git/git/commit/5a518ad4679c91f0d0afd38fcc3cbf04e8699c46).

This commit adds an option to Repo::Add to pass this to git, and makes
Setup pass it by default.
parent 469e9a24
...@@ -8,7 +8,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -8,7 +8,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Enhancements ##### Enhancements
* None. * Show git progress when downloading the CocoaPods Specs repo.
[Danielle Tomlinson](https://github.com/dantoml)
[#5937](https://github.com/CocoaPods/CocoaPods/issues/5937)
##### Bug Fixes ##### Bug Fixes
......
...@@ -15,10 +15,17 @@ module Pod ...@@ -15,10 +15,17 @@ module Pod
CLAide::Argument.new('BRANCH', false), CLAide::Argument.new('BRANCH', false),
] ]
def self.options
[
['--progress', 'Show the progress of cloning the spec repository']
].concat(super)
end
def initialize(argv) def initialize(argv)
@name = argv.shift_argument @name = argv.shift_argument
@url = argv.shift_argument @url = argv.shift_argument
@branch = argv.shift_argument @branch = argv.shift_argument
@progress = argv.flag?('progress')
super super
end end
...@@ -66,11 +73,22 @@ module Pod ...@@ -66,11 +73,22 @@ module Pod
# @return [void] # @return [void]
# #
def clone_repo def clone_repo
changes = if @progress
{ verbose: true }
else
{}
end
config.with_changes(changes) do
Dir.chdir(config.repos_dir) do Dir.chdir(config.repos_dir) do
command = ['clone', @url, @name] command = ['clone', @url, @name]
if @progress
command << '--progress'
end
git!(command) git!(command)
end end
end end
end
# Checks out the branch of the git spec-repo if provided. # Checks out the branch of the git spec-repo if provided.
# #
......
...@@ -50,7 +50,7 @@ module Pod ...@@ -50,7 +50,7 @@ module Pod
# @return [void] # @return [void]
# #
def add_master_repo def add_master_repo
cmd = ['master', url, 'master'] cmd = ['master', url, 'master', '--progress']
Repo::Add.parse(cmd).run Repo::Add.parse(cmd).run
end end
......
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