Commit 9a29cfd9 authored by Balasankar "Balu" C's avatar Balasankar "Balu" C

Refactor notification branch selection

Signed-off-by: default avatarBalasankar "Balu" C <balasankar@gitlab.com>
parent 2510a6a0
...@@ -20,13 +20,14 @@ module NotificationBranchSelection ...@@ -20,13 +20,14 @@ module NotificationBranchSelection
is_default_branch = ref == project.default_branch is_default_branch = ref == project.default_branch
is_protected_branch = project.protected_branches.exists?(name: ref) is_protected_branch = project.protected_branches.exists?(name: ref)
if branches_to_be_notified == "all" case branches_to_be_notified
when "all"
true true
elsif branches_to_be_notified == "default" when "default"
is_default_branch is_default_branch
elsif branches_to_be_notified == "protected" when "protected"
is_protected_branch is_protected_branch
elsif branches_to_be_notified == "default_and_protected" when "default_and_protected"
is_default_branch || is_protected_branch is_default_branch || is_protected_branch
else else
false false
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment