diff --git a/init.rb b/init.rb index 6685881..241853f 100644 --- a/init.rb +++ b/init.rb @@ -4,6 +4,7 @@ require_dependency 'welcome_controller_patch' require_dependency 'project_model_patch' require_dependency 'mailer_patch' require_dependency 'attachments_controller_patch' +require_dependency 'git_adapter_patch' Redmine::Plugin.register :redmine_entrouvert do name 'Redmine Entr\'ouvert plugin' diff --git a/lib/git_adapter_patch.rb b/lib/git_adapter_patch.rb new file mode 100644 index 0000000..37f9619 --- /dev/null +++ b/lib/git_adapter_patch.rb @@ -0,0 +1,19 @@ +require 'redmine/scm/adapters/git_adapter.rb' + +# skip wip/ branches + +module Redmine + module Scm + module Adapters + class GitAdapter + + alias_method :branches_original, :branches + + def branches(*args) + all_branches = branches_original(*args) + all_branches.find_all { |b| !b.start_with("wip/") } + end + end + end + end +end