Unverified Commit 4ea4f5ae authored by Dimitris Koutsogiorgas's avatar Dimitris Koutsogiorgas Committed by GitHub

Merge pull request #7179 from jonsorrells/fix-pod-update-silent

Prevent passing empty string to git when running pod repo update --silent
parents 9c17afa3 398e9c60
...@@ -12,6 +12,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -12,6 +12,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes ##### Bug Fixes
* Prevent passing empty string to git when running `pod repo update --silent`
[Jon Sorrells](https://github.com/jonsorrells)
[#7176](https://github.com/CocoaPods/CocoaPods/issues/7176)
* Do not propagate test spec frameworks and libraries into pod target xcconfig * Do not propagate test spec frameworks and libraries into pod target xcconfig
[Dimitris Koutsogiorgas](https://github.com/dnkoutso) [Dimitris Koutsogiorgas](https://github.com/dnkoutso)
[#7172](https://github.com/CocoaPods/CocoaPods/issues/7172) [#7172](https://github.com/CocoaPods/CocoaPods/issues/7172)
......
...@@ -104,7 +104,9 @@ module Pod ...@@ -104,7 +104,9 @@ module Pod
def update_git_repo(show_output = false) def update_git_repo(show_output = false)
Config.instance.with_changes(:verbose => show_output) do Config.instance.with_changes(:verbose => show_output) do
git!(%W(-C #{repo} fetch origin #{show_output ? '--progress' : ''})) args = %W(-C #{repo} fetch origin)
args.push('--progress') if show_output
git!(args)
current_branch = git!(%W(-C #{repo} rev-parse --abbrev-ref HEAD)).strip current_branch = git!(%W(-C #{repo} rev-parse --abbrev-ref HEAD)).strip
git!(%W(-C #{repo} reset --hard origin/#{current_branch})) git!(%W(-C #{repo} reset --hard origin/#{current_branch}))
end end
......
...@@ -111,6 +111,30 @@ module Pod ...@@ -111,6 +111,30 @@ module Pod
@sources_manager.update(test_repo_path.basename.to_s, true) @sources_manager.update(test_repo_path.basename.to_s, true)
end end
it 'updates source with --silent flag' do
set_up_test_repo_for_update
@sources_manager.expects(:update_search_index_if_needed_in_background).with({}).returns(nil)
repo_update = sequence('repo update --silent')
MasterSource.any_instance.
expects(:git!).
with(%W(-C #{test_repo_path} fetch origin)).
in_sequence(repo_update)
MasterSource.any_instance.
expects(:git!).
with(%W(-C #{test_repo_path} rev-parse --abbrev-ref HEAD)).
returns("my-special-branch\n").
in_sequence(repo_update)
MasterSource.any_instance.
expects(:git!).
with(%W(-C #{test_repo_path} reset --hard origin/my-special-branch)).
in_sequence(repo_update)
@sources_manager.update(test_repo_path.basename.to_s, false)
end
it 'unshallows if the git repo is shallow' do it 'unshallows if the git repo is shallow' do
set_up_test_repo_for_update set_up_test_repo_for_update
test_repo_path.join('.git', 'shallow').open('w') { |f| f << 'a' * 40 } test_repo_path.join('.git', 'shallow').open('w') { |f| f << 'a' * 40 }
......
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