From aef9b6d19025379477d2127998cdfca929ba748b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Thu, 7 May 2015 09:35:54 +0200 Subject: [PATCH] ignore wip/ branches from git --- init.rb | 1 + lib/git_adapter_patch.rb | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 lib/git_adapter_patch.rb 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