Skip to content

Commit

Permalink
Add an option for reset
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent Lepot committed Jul 7, 2015
1 parent 44d836b commit b573202
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/capistrano/rsync.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

set_if_empty :enable_git_submodules, false

set_if_empty :reset_git_submodules_before_update, false

# NOTE: Please don't depend on tasks without a description (`desc`) as they
# might change between minor or patch version releases. They make up the
# private API and internals of Capistrano::Rsync. If you think something should
Expand Down Expand Up @@ -167,7 +169,9 @@ def has_roles?
execute :git, :reset, '--quiet', '--hard', "#{rsync_target.call}"

if fetch(:enable_git_submodules)
execute :git, :submodule, :foreach, "git reset --hard HEAD"
if fetch(:reset_git_submodules_before_update)
execute :git, :submodule, :foreach, "git reset --hard HEAD"
end

execute :git, :submodule, :update
end
Expand Down

0 comments on commit b573202

Please sign in to comment.