Permalink
Browse files

support apps with changed git urls

  • Loading branch information...
Andy Delcambre Samuel Tesla
Andy Delcambre authored and Samuel Tesla committed Sep 15, 2009
1 parent a856ea2 commit f98946b4644307bbf2c4c9b5d6f93614ff0db7f4
Showing with 5 additions and 1 deletion.
  1. +2 −1 lib/chef-deploy/cached_deploy.rb
  2. +3 −0 lib/chef-deploy/git.rb
@@ -247,7 +247,8 @@ def repository_cache
end
def update_repository_cache
- command = "if [ -d #{repository_cache} ]; then " +
+ command = "if [ -d #{repository_cache} ] &&" +
+ "git --git-dir #{repository_cache}/.git/ remote -v | grep -q #{configuration[:repository]}; then " +
"#{source.sync(revision, repository_cache)}; " +
"else #{source.checkout(revision, repository_cache)}; fi"
command
View
@@ -32,6 +32,9 @@ def checkout(revision, destination)
end
execute = []
+
+ execute << "rm -rf #{destination}"
+
if args.empty?
execute << "#{git} clone #{verbose} #{configuration[:repository]} #{destination}"
else

0 comments on commit f98946b

Please sign in to comment.