mirror of
https://github.com/capistrano/capistrano
synced 2023-03-27 23:21:18 -04:00
Throw exception on git failure, rather than exit silently
This commit is contained in:
parent
53957e7d19
commit
c9f600d3aa
4 changed files with 4 additions and 3 deletions
|
@ -11,6 +11,7 @@ https://github.com/capistrano/capistrano/compare/v3.2.0...HEAD
|
|||
* Changed asking question to more standard format (like common unix commandline tools) (@sponomarev)
|
||||
* Fixed typos in the README. (@sponomarev)
|
||||
* Added `keys` method to Configuration to allow introspection of configuration options. (@juanibiapina)
|
||||
* Improve error message when git:check fails (raise instead of silently `exit 1`) (@mbrictson)
|
||||
|
||||
## `3.2.0`
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ class Capistrano::Git < Capistrano::SCM
|
|||
end
|
||||
|
||||
def check
|
||||
test! :git, :'ls-remote -h', repo_url
|
||||
git :'ls-remote -h', repo_url
|
||||
end
|
||||
|
||||
def clone
|
||||
|
|
|
@ -25,7 +25,7 @@ namespace :git do
|
|||
fetch(:branch)
|
||||
on release_roles :all do
|
||||
with fetch(:git_environmental_variables) do
|
||||
exit 1 unless strategy.check
|
||||
strategy.check
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -31,7 +31,7 @@ module Capistrano
|
|||
describe "#check" do
|
||||
it "should test the repo url" do
|
||||
context.expects(:repo_url).returns(:url)
|
||||
context.expects(:test).with(:git, :'ls-remote -h', :url).returns(true)
|
||||
context.expects(:execute).with(:git, :'ls-remote -h', :url).returns(true)
|
||||
|
||||
subject.check
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue