Changeset 8904
- Timestamp:
- 02/19/08 23:37:50 (5 months ago)
- Files:
-
- tools/capistrano/test/deploy/scm/git_test.rb (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
tools/capistrano/test/deploy/scm/git_test.rb
r8759 r8904 23 23 @config[:repository] = "git@somehost.com:project.git" 24 24 dest = "/var/www" 25 assert_equal "git clone git@somehost.com:project.git /var/www && cd /var/www && git checkout -b deployHEAD", @source.checkout('Not used', dest)25 assert_equal "git clone git@somehost.com:project.git /var/www && cd /var/www && git checkout HEAD", @source.checkout('Not used', dest) 26 26 27 27 # With branch 28 28 @config[:branch] = "origin/foo" 29 assert_equal "git clone git@somehost.com:project.git /var/www && cd /var/www && git checkout -b deployorigin/foo", @source.checkout('Not used', dest)29 assert_equal "git clone git@somehost.com:project.git /var/www && cd /var/www && git checkout origin/foo", @source.checkout('Not used', dest) 30 30 end 31 31 … … 52 52 def test_sync 53 53 dest = "/var/www" 54 assert_equal "cd #{dest} && git fetch origin && git mergeorigin/HEAD", @source.sync('Not used', dest)54 assert_equal "cd #{dest} && git fetch origin && git checkout origin/HEAD", @source.sync('Not used', dest) 55 55 56 56 # With branch 57 57 @config[:branch] = "origin/foo" 58 assert_equal "cd #{dest} && git fetch origin && git mergeorigin/foo", @source.sync('Not used', dest)58 assert_equal "cd #{dest} && git fetch origin && git checkout origin/foo", @source.sync('Not used', dest) 59 59 60 60 # With :scm_command 61 61 @config[:scm_command] = "/opt/local/bin/git" 62 assert_equal "cd #{dest} && /opt/local/bin/git fetch origin && /opt/local/bin/git mergeorigin/foo", @source.sync('Not used', dest)62 assert_equal "cd #{dest} && /opt/local/bin/git fetch origin && /opt/local/bin/git checkout origin/foo", @source.sync('Not used', dest) 63 63 end 64 64 … … 67 67 @config[:git_shallow_clone] = 1 68 68 dest = "/var/www" 69 assert_equal "git clone --depth 1 git@somehost.com:project.git /var/www && cd /var/www && git checkout -b deployHEAD", @source.checkout('Not used', dest)69 assert_equal "git clone --depth 1 git@somehost.com:project.git /var/www && cd /var/www && git checkout HEAD", @source.checkout('Not used', dest) 70 70 71 71 # With branch 72 72 @config[:branch] = "origin/foo" 73 assert_equal "git clone --depth 1 git@somehost.com:project.git /var/www && cd /var/www && git checkout -b deployorigin/foo", @source.checkout('Not used', dest)73 assert_equal "git clone --depth 1 git@somehost.com:project.git /var/www && cd /var/www && git checkout origin/foo", @source.checkout('Not used', dest) 74 74 end 75 75