Permalink
Browse files

extract refresh local cache code to its own method

  • Loading branch information...
1 parent afbfe76 commit 3d3063588612389004df439d8025d3f3d0a2bc79 @despo committed Mar 16, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/capistrano/recipes/deploy/strategy/copy.rb
@@ -56,8 +56,7 @@ class Copy < Base
def deploy!
if copy_cache
if File.exists?(copy_cache)
- logger.debug "refreshing local cache to revision #{revision} at #{copy_cache}"
- system(source.sync(revision, copy_cache))
+ refresh_local_cache
else
logger.debug "preparing local cache at #{copy_cache}"
system(source.checkout(revision, copy_cache))
@@ -153,6 +152,11 @@ def copy_cache
private
+ def refresh_local_cache
+ logger.debug "refreshing local cache to revision #{revision} at #{copy_cache}"
+ system(source.sync(revision, copy_cache))
+ end
+
# Specify patterns to exclude from the copy. This is only valid
# when using a local cache.
def copy_exclude

0 comments on commit 3d30635

Please sign in to comment.