Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
b8704dce
Commit
b8704dce
authored
Jun 07, 2019
by
Krasimir Angelov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Comment why forks get default_git_depth of 0 instead nil
and simplify ProjectCiCdSetting#set_default_git_depth
parent
c0a812ec
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
app/models/project_ci_cd_setting.rb
app/models/project_ci_cd_setting.rb
+1
-3
app/services/projects/fork_service.rb
app/services/projects/fork_service.rb
+3
-0
No files found.
app/models/project_ci_cd_setting.rb
View file @
b8704dce
...
@@ -31,8 +31,6 @@ class ProjectCiCdSetting < ApplicationRecord
...
@@ -31,8 +31,6 @@ class ProjectCiCdSetting < ApplicationRecord
private
private
def
set_default_git_depth
def
set_default_git_depth
return
if
default_git_depth
self
.
default_git_depth
||=
DEFAULT_GIT_DEPTH
self
.
default_git_depth
=
DEFAULT_GIT_DEPTH
end
end
end
end
app/services/projects/fork_service.rb
View file @
b8704dce
...
@@ -43,6 +43,9 @@ module Projects
...
@@ -43,6 +43,9 @@ module Projects
shared_runners_enabled:
@project
.
shared_runners_enabled
,
shared_runners_enabled:
@project
.
shared_runners_enabled
,
namespace_id:
target_namespace
.
id
,
namespace_id:
target_namespace
.
id
,
fork_network:
fork_network
,
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
},
ci_cd_settings_attributes:
{
default_git_depth:
@project
.
default_git_depth
||
0
},
# We need to assign the fork network membership after the project has
# We need to assign the fork network membership after the project has
# been instantiated to avoid ActiveRecord trying to create it when
# been instantiated to avoid ActiveRecord trying to create it when
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment