Skip to content

Commit

Permalink
Split out branch_copy_flags method to placate code complexity check
Browse files Browse the repository at this point in the history
  • Loading branch information
smcv committed Feb 19, 2014
1 parent 0f508c3 commit 7968c7f
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/api/app/models/project.rb
Expand Up @@ -1070,10 +1070,18 @@ def branch_to_repositories_from(project, pkg_to_enable, extend_names=nil)
end
pkg_to_enable.enable_for_repository(repoName) if pkg_to_enable
end
# Take over flags, but enable building.
# By default, disable 'publish' to save space and bandwidth, but this
# can be turned off for small installations.
# Also omit 'lock' or we cannot create packages.

self.branch_copy_flags(project)
end

def branch_copy_flags(project)
# Copy the flags from the other project, adjusting them appropriately
# for this one being a branch of it:
#
# - enable building
# - disable 'publish' to save space and bandwidth
# (can be turned off for small installations)
# - omit 'lock' or we cannot create packages
disable_publish_for_branches = ::Configuration.first.disable_publish_for_branches
project.flags.each do |f|
next if %w(build lock).include?(f.flag)
Expand Down

0 comments on commit 7968c7f

Please sign in to comment.