Commit c1fbc6d0 authored by Uku Loskit's avatar Uku Loskit

exit with a non-zero exit code when git pull --ff-only fails instead of just showing a warning

parent 2221f4f3
......@@ -16,6 +16,11 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Danielle Tomlinson](https://github.com/dantoml)
[#6042](https://github.com/CocoaPods/CocoaPods/pull/6042)
* Exit with non-zero exit status if pod repo update fails
[Uku Loskit](https://github.com/UkuLoskit)
[#6037](https://github.com/CocoaPods/CocoaPods/issues/6037)
##### Bug Fixes
* None.
......
......@@ -107,10 +107,10 @@ module Pod
git!(['-C', repo, 'pull', '--ff-only'])
end
rescue
UI.warn 'CocoaPods was not able to update the ' \
"`#{name}` repo. If this is an unexpected issue " \
'and persists you can inspect it running ' \
'`pod repo update --verbose`'
raise Informative, 'CocoaPods was not able to update the ' \
"`#{name}` repo. If this is an unexpected issue " \
'and persists you can inspect it running ' \
'`pod repo update --verbose`'
end
end
......
......@@ -135,9 +135,8 @@ fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
EOS
@sources_manager.expects(:update_search_index_if_needed_in_background).with({}).returns(nil)
@sources_manager.update(test_repo_path.basename.to_s, true)
UI.warnings.should.include('not able to update the `master` repo')
e = lambda { @sources_manager.update(test_repo_path.basename.to_s, true) }.should.raise Pod::Informative
e.message.should.include('not able to update the `master` repo')
end
it 'informs the user if there is an update for CocoaPods' do
......
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