Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

joining an empty array yields an empty string; no harm done & DRY

  • Loading branch information...
commit 697bffb3a25ffecf9dced0d52d07b3dfbf8a8a2b 1 parent cb70695
@sunaku sunaku authored
View
6 lib/capistrano/recipes/deploy/scm/git.rb
@@ -140,11 +140,7 @@ def checkout(revision, destination)
end
execute = []
- if args.empty?
- execute << "#{git} clone #{verbose} #{variable(:repository)} #{destination}"
- else
- execute << "#{git} clone #{verbose} #{args.join(' ')} #{variable(:repository)} #{destination}"
- end
+ execute << "#{git} clone #{verbose} #{args.join(' ')} #{variable(:repository)} #{destination}"
# checkout into a local branch rather than a detached HEAD
execute << "cd #{destination} && #{git} checkout #{verbose} -b deploy #{revision}"
View
4 test/deploy/scm/git_test.rb
@@ -31,7 +31,7 @@ def test_checkout
@config[:repository] = "git@somehost.com:project.git"
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)
+ 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)
# With :scm_command
git = "/opt/local/bin/git"
@@ -48,7 +48,7 @@ def test_checkout_with_verbose_should_not_use_q_switch
@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)
+ 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_diff
Please sign in to comment.
Something went wrong with that request. Please try again.