diff options
author | Krasimir Angelov <kangelov@gitlab.com> | 2019-06-06 15:39:46 +0300 |
---|---|---|
committer | Krasimir Angelov <kangelov@gitlab.com> | 2019-06-06 15:39:46 +0300 |
commit | b8704dce72fd8992b1f785c0ffa2f2c0eab81334 (patch) | |
tree | 203686a6e2c95c88857d5f71dd748d4fa715887e /app/services/projects/fork_service.rb | |
parent | c0a812ecb74f1fd519d096d8be36f0a2436adc94 (diff) |
Comment why forks get default_git_depth of 0 instead nil
and simplify ProjectCiCdSetting#set_default_git_depth
Diffstat (limited to 'app/services/projects/fork_service.rb')
-rw-r--r-- | app/services/projects/fork_service.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/app/services/projects/fork_service.rb b/app/services/projects/fork_service.rb index f1bad2d9b15..0b4ab7b8e4d 100644 --- a/app/services/projects/fork_service.rb +++ b/app/services/projects/fork_service.rb @@ -43,6 +43,9 @@ module Projects shared_runners_enabled: @project.shared_runners_enabled, namespace_id: target_namespace.id, fork_network: fork_network, + # We need to set default_git_depth to 0 for the forked project when + # @project.default_git_depth is nil in order to keep the same behaviour + # and not get ProjectCiCdSetting::DEFAULT_GIT_DEPTH set on create ci_cd_settings_attributes: { default_git_depth: @project.default_git_depth || 0 }, # We need to assign the fork network membership after the project has # been instantiated to avoid ActiveRecord trying to create it when |