mirror of
https://github.com/capistrano/capistrano
synced 2023-03-27 23:21:18 -04:00
Make sure git fetches include tags [#6 tagged:committed status:resolved]
This commit is contained in:
parent
552a492428
commit
838f6abd74
3 changed files with 6 additions and 4 deletions
|
@ -1,5 +1,7 @@
|
|||
*unreleased*
|
||||
|
||||
* Make sure git fetches include tags [Alex Arnell]
|
||||
|
||||
* Make deploy:setup obey the :use_sudo and :runner directives, and generalize the :use_sudo and :runner options into a try_sudo() helper method [Jamis Buck]
|
||||
|
||||
* Make sudo helper play nicely with complex command chains [Jamis Buck]
|
||||
|
|
|
@ -184,7 +184,7 @@ module Capistrano
|
|||
end
|
||||
|
||||
# since we're in a local branch already, just reset to specified revision rather than merge
|
||||
execute << "#{git} fetch #{remote} && #{git} reset --hard #{revision}"
|
||||
execute << "#{git} fetch --tags #{remote} && #{git} reset --hard #{revision}"
|
||||
|
||||
if configuration[:git_enable_submodules]
|
||||
execute << "#{git} submodule init"
|
||||
|
|
|
@ -66,12 +66,12 @@ class DeploySCMGitTest < Test::Unit::TestCase
|
|||
def test_sync
|
||||
dest = "/var/www"
|
||||
rev = 'c2d9e79'
|
||||
assert_equal "cd #{dest} && git fetch origin && git reset --hard #{rev}", @source.sync(rev, dest)
|
||||
assert_equal "cd #{dest} && git fetch --tags origin && git reset --hard #{rev}", @source.sync(rev, dest)
|
||||
|
||||
# With :scm_command
|
||||
git = "/opt/local/bin/git"
|
||||
@config[:scm_command] = git
|
||||
assert_equal "cd #{dest} && #{git} fetch origin && #{git} reset --hard #{rev}", @source.sync(rev, dest)
|
||||
assert_equal "cd #{dest} && #{git} fetch --tags origin && #{git} reset --hard #{rev}", @source.sync(rev, dest)
|
||||
end
|
||||
|
||||
def test_sync_with_remote
|
||||
|
@ -83,7 +83,7 @@ class DeploySCMGitTest < Test::Unit::TestCase
|
|||
@config[:repository] = repository
|
||||
@config[:remote] = remote
|
||||
|
||||
assert_equal "cd #{dest} && git config remote.#{remote}.url #{repository} && git config remote.#{remote}.fetch +refs/heads/*:refs/remotes/#{remote}/* && git fetch #{remote} && git reset --hard #{rev}", @source.sync(rev, dest)
|
||||
assert_equal "cd #{dest} && git config remote.#{remote}.url #{repository} && git config remote.#{remote}.fetch +refs/heads/*:refs/remotes/#{remote}/* && git fetch --tags #{remote} && git reset --hard #{rev}", @source.sync(rev, dest)
|
||||
end
|
||||
|
||||
def test_shallow_clone
|
||||
|
|
Loading…
Reference in a new issue