Permalink
Browse files

Split out branch_copy_flags method to placate code complexity check

  • Loading branch information...
1 parent 0f508c3 commit 7968c7f0f371234164d2ba66e8438e300a0d1547 @smcv committed Feb 19, 2014
Showing with 12 additions and 4 deletions.
  1. +12 −4 src/api/app/models/project.rb
@@ -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)

0 comments on commit 7968c7f

Please sign in to comment.