Skip to content

Commit

Permalink
Fixed depth option when cloning
Browse files Browse the repository at this point in the history
  • Loading branch information
Bladrak committed Jul 2, 2015
1 parent 6a64e25 commit 0230029
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.3.0 (Jul 2, 2015)
- Refactored library to use run_locally and execute from Capistrano, so the output is uniformized & we exit on failed commands
- Added some options as well (see README.md for complete list)
- [BC BREAK] Execution context may have changed, if you've overridden some options taking into account execution path for instance.

## 1.1.0 (Jan 17, 2015)
- Added ``:rsync_sparse_checkout`` option

Expand Down
9 changes: 7 additions & 2 deletions lib/capistrano/rsync.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@
depth
end

git_depth_clone = lambda do
depth = !!fetch(:rsync_depth, false) ? "--depth=#{fetch(:rsync_depth)} --no-single-branch" : ""
depth
end

Rake::Task["deploy:check"].enhance ["rsync:hook_scm"]

# Local -> Remote cache
Expand Down Expand Up @@ -140,7 +145,7 @@ def has_roles?
'--quiet',
fetch(:repo_url),
fetch(:rsync_stage),
"#{git_depth.call}",
"#{git_depth_clone.call}",
"#{submodules}"
end
end
Expand All @@ -157,7 +162,7 @@ def has_roles?
execute :git, :fetch, '--quiet --all --prune', "#{tags}", "#{git_depth.call}"

execute :git, :reset, '--quiet', '--hard', "#{rsync_target.call}"

if fetch(:enable_git_submodules)
execute :git, :submodule, :update
end
Expand Down
2 changes: 1 addition & 1 deletion lib/capistrano/rsync/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Capistrano
module Rsync
VERSION = "1.2.5"
VERSION = "1.3.0"
end
end

0 comments on commit 0230029

Please sign in to comment.