Commit fbd48c13 authored by Fabio Pelosin's avatar Fabio Pelosin

[SourceManager] Disable remote check on update in favour of a warning

Closes https://github.com/CocoaPods/CocoaPods/issues/2388
parent d311e447
......@@ -158,8 +158,10 @@ module Pod
output = git!("pull --ff-only")
UI.puts output if show_output && !config.verbose?
rescue Informative => e
raise Informative, 'An error occurred while performing ' \
"`git pull` on repo `#{source.name}`.\n" + e.message
UI.warn "CocoaPods was not able to update the " \
"`#{source.name}` repo. If this is an unexpected issue " \
"and persists you can inspect it running " \
"`pod repo update --verbose`"
end
end
check_version_information(source.data_provider.repo)
......@@ -334,8 +336,7 @@ module Pod
#
def git_sources
aggregate.all.select do |source|
git_repo?(source.data_provider.repo) &&
git_remote_reachable?(source.data_provider.repo)
git_repo?(source.data_provider.repo)
end
end
end
......
......@@ -124,6 +124,16 @@ module Pod
SourcesManager.update(test_repo_path.basename.to_s, true)
end
it "prints a warning if the update failed" do
UI.warnings = ''
set_up_test_repo_for_update
Dir.chdir(test_repo_path) do
`git remote set-url origin https://example.com`
end
SourcesManager.update(test_repo_path.basename.to_s, true)
UI.warnings.should.include('not able to update the `master` repo')
end
it 'returns whether a source has a reachable git remote' do
SourcesManager.git_remote_reachable?(repo_make('a_new_repo_that_is_new')).should.be.false
SourcesManager.git_remote_reachable?(SourcesManager.master_repo_dir).should.be.true
......
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