Commit e0bb44c7 authored by Dimitris Koutsogiorgas's avatar Dimitris Koutsogiorgas Committed by GitHub

Merge pull request #6700 from dnkoutso/exit_code_push

Use `git!` when executing `push` command in order to raise informativ…
parents ad59b03d c30e0909
...@@ -14,6 +14,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -14,6 +14,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes ##### Bug Fixes
* Use `git!` when executing `push` command in order to raise informative and set exit code.
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
[#6700](https://github.com/CocoaPods/CocoaPods/pull/6700)
* Make copy resources echoes always return true to work around issue where Xcode stops handling build script output greater than ~440 characters (rdar://30607704). * Make copy resources echoes always return true to work around issue where Xcode stops handling build script output greater than ~440 characters (rdar://30607704).
[postmechanical](https://github.com/postmechanical) [postmechanical](https://github.com/postmechanical)
[#6595](https://github.com/CocoaPods/CocoaPods/issues/6595) [#6595](https://github.com/CocoaPods/CocoaPods/issues/6595)
......
...@@ -213,7 +213,7 @@ module Pod ...@@ -213,7 +213,7 @@ module Pod
# #
def push_repo def push_repo
UI.puts "\nPushing the `#{@repo}' repo\n".yellow UI.puts "\nPushing the `#{@repo}' repo\n".yellow
UI.puts `git -C "#{repo_dir}" push origin master 2>&1` repo_git('-C', repo_dir, 'push', 'origin', 'master')
end end
#---------------------------------------------------------------------# #---------------------------------------------------------------------#
......
...@@ -177,7 +177,11 @@ module Pod ...@@ -177,7 +177,11 @@ module Pod
Validator.any_instance.expects(:podfile_from_spec).with(:tvos, nil, true).twice Validator.any_instance.expects(:podfile_from_spec).with(:tvos, nil, true).twice
cmd = command('repo', 'push', 'master') cmd = command('repo', 'push', 'master')
# Git push will throw an exception here since this is a local custom git repo. All we care is the validator
# tests so the exception is swallowed.
lambda do
Dir.chdir(temporary_directory) { cmd.run } Dir.chdir(temporary_directory) { cmd.run }
end.should.raise Informative
end end
it 'validates specs as libraries if requested' do it 'validates specs as libraries if requested' do
...@@ -187,7 +191,19 @@ module Pod ...@@ -187,7 +191,19 @@ module Pod
Validator.any_instance.expects(:podfile_from_spec).with(:tvos, nil, false).twice Validator.any_instance.expects(:podfile_from_spec).with(:tvos, nil, false).twice
cmd = command('repo', 'push', 'master', '--use-libraries') cmd = command('repo', 'push', 'master', '--use-libraries')
# Git push will throw an exception here since this is a local custom git repo. All we care is the validator
# tests so the exception is swallowed.
lambda do
Dir.chdir(temporary_directory) { cmd.run } Dir.chdir(temporary_directory) { cmd.run }
end.should.raise Informative
end
it 'raises error and exit code when push fails' do
cmd = command('repo', 'push', 'master')
e = lambda do
Dir.chdir(temporary_directory) { cmd.run }
end.should.raise Informative
e.exit_status.should.equal(1)
end end
end end
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