xuwupeng2000/capsitrano-scm-gitcopy — pull request #2 by tobowers (2014-09-29 17:31:53+00:00)
Title: use the after hook to make sure to only cleanup the local file once

currently if you are deploying to multiple servers you can run into a race condition where the if File.exists? in the clean task returns true but then the OS will error when actually removing.

Capistrano supports before/after hooks - so use those to maintain threadsafety.