Changeset 8755
- Timestamp:
- 01/30/08 06:21:49 (6 months ago)
- Files:
-
- tools/capistrano/CHANGELOG (modified) (1 diff)
- tools/capistrano/lib/capistrano/recipes/deploy/scm/git.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
tools/capistrano/CHANGELOG
r8754 r8755 1 1 *SVN* 2 3 * Add support for :git_enable_submodules variable, to enable submodules with the git SCM [halorgium] 2 4 3 5 * If subversion asks for a password, prompt as a last resort [Jamis Buck] tools/capistrano/lib/capistrano/recipes/deploy/scm/git.rb
r7695 r8755 112 112 fail "No branch specified, use for example 'set :branch, \"origin/master\"' in your deploy.rb" unless branch 113 113 114 execute = [] 114 115 if depth = configuration[:git_shallow_clone] 115 execute = "#{git} clone --depth #{depth} #{configuration[:repository]} #{destination} &&"116 execute << "#{git} clone --depth #{depth} #{configuration[:repository]} #{destination}" 116 117 else 117 execute = "#{git} clone #{configuration[:repository]} #{destination} && " 118 end 119 120 execute += "cd #{destination} && #{git} checkout -b deploy #{branch}" 121 122 execute 118 execute << "#{git} clone #{configuration[:repository]} #{destination}" 119 end 120 121 execute << "cd #{destination}" 122 execute << "#{git} checkout -b deploy #{branch}" 123 if configuration[:git_enable_submodules] 124 execute << "#{git} submodule init" 125 execute << "#{git} submodule update" 126 end 127 128 execute.join(" && ") 123 129 end 124 130 … … 126 132 # deployment strategy 127 133 def sync(revision, destination) 128 execute = "cd #{destination} && git fetch origin && " 134 git = command 135 execute = [] 136 execute << "cd #{destination} && #{git} fetch origin" 129 137 130 138 if head == 'HEAD' 131 execute += "gitmerge origin/HEAD"139 execute << "#{git} merge origin/HEAD" 132 140 else 133 execute += "git merge #{head}" 134 end 135 136 execute 141 execute << "#{git} merge #{head}" 142 end 143 144 if configuration[:git_enable_submodules] 145 execute << "#{git} submodule update" 146 end 147 148 execute.join(" && ") 137 149 end 138 150