Skip to content

Commit

Permalink
Git: add option to disable --dissociate flag on cloning (#1820)
Browse files Browse the repository at this point in the history
  • Loading branch information
Slamdunk authored and antonmedv committed Mar 28, 2019
1 parent c21210e commit ec0e8c4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
## master
[v6.4.3...master](https://github.com/deployphp/deployer/compare/v6.4.3...master)

### Added
- Added `git_clone_dissociate` option, defaults to true; when set to false git-clone doesn't dissociate the eventual reference repository after clone, useful when using git-lfs [#1820]

### Changed
- Add lock and unlock task to flow_framework receipe

Expand Down Expand Up @@ -460,6 +463,7 @@
- Fixed remove of shared dir on first deploy


[#1820]: https://github.com/deployphp/deployer/pull/1820
[#1796]: https://github.com/deployphp/deployer/pull/1796
[#1793]: https://github.com/deployphp/deployer/pull/1793
[#1792]: https://github.com/deployphp/deployer/pull/1792
Expand Down
3 changes: 2 additions & 1 deletion recipe/deploy/update_code.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
$git = get('bin/git');
$gitCache = get('git_cache');
$recursive = get('git_recursive', true) ? '--recursive' : '';
$dissociate = get('git_clone_dissociate', true) ? '--dissociate' : '';
$quiet = isQuiet() ? '-q' : '';
$depth = $gitCache ? '' : '--depth 1';
$options = [
Expand Down Expand Up @@ -85,7 +86,7 @@

if ($gitCache && has('previous_release')) {
try {
run("$git clone $at $recursive $quiet --reference {{previous_release}} --dissociate $repository {{release_path}} 2>&1", $options);
run("$git clone $at $recursive $quiet --reference {{previous_release}} $dissociate $repository {{release_path}} 2>&1", $options);
} catch (\Throwable $exception) {
// If {{deploy_path}}/releases/{$releases[1]} has a failed git clone, is empty, shallow etc, git would throw error and give up. So we're forcing it to act without reference in this situation
run("$git clone $at $recursive $quiet $repository {{release_path}} 2>&1", $options);
Expand Down

0 comments on commit ec0e8c4

Please sign in to comment.