Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

git SCM class correctly respects scm_verbose setting

  • Loading branch information...
commit 8b7a51fba85b04fce67d5761b9cfc06e79a7b65b 1 parent b5681ad
@dubek dubek authored
View
2  lib/capistrano/recipes/deploy/scm/git.rb
@@ -274,7 +274,7 @@ def handle_data(state, stream, text)
# If verbose output is requested, return nil, otherwise return the
# command-line switch for "quiet" ("-q").
def verbose
- variable(:scm_verbose, true) ? "-q" : nil
+ variable(:scm_verbose) ? nil : "-q"
end
end
end
View
10 test/deploy/scm/git_test.rb
@@ -43,11 +43,19 @@ def test_checkout
assert_equal "#{git} clone -q git@somehost.com:project.git /var/www && cd /var/www && #{git} checkout -q -b deploy #{rev} && #{git} submodule -q init && #{git} submodule -q sync && #{git} submodule -q update --init --recursive", @source.checkout(rev, dest).gsub(/\s+/, ' ')
end
- def test_checkout_with_verbose_should_use_q_switch
+ def test_checkout_with_verbose_should_not_use_q_switch
@config[:repository] = "git@somehost.com:project.git"
@config[:scm_verbose] = true
dest = "/var/www"
rev = 'c2d9e79'
+ assert_equal "git clone git@somehost.com:project.git /var/www && cd /var/www && git checkout -b deploy #{rev}", @source.checkout(rev, dest)
+ end
+
+ def test_checkout_with_verbose_off_should_use_q_switch
+ @config[:repository] = "git@somehost.com:project.git"
+ @config[:scm_verbose] = false
+ dest = "/var/www"
+ rev = 'c2d9e79'
assert_equal "git clone -q git@somehost.com:project.git /var/www && cd /var/www && git checkout -q -b deploy #{rev}", @source.checkout(rev, dest)
end
Please sign in to comment.
Something went wrong with that request. Please try again.