diff --git a/CHANGELOG.md b/CHANGELOG.md index bb7fcb1f5..199ff8155 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 @@ -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 diff --git a/recipe/deploy/update_code.php b/recipe/deploy/update_code.php index 3db081b2f..3946a3ed2 100644 --- a/recipe/deploy/update_code.php +++ b/recipe/deploy/update_code.php @@ -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 = [ @@ -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);