Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@ public class BranchFilter {

public static final String NO_BRANCHES = "";
private final BranchMatcher blacklistedBranches;
private final BranchMatcher whitelistedBrandches;
private final BranchMatcher whitelistedBranches;

public BranchFilter() {
this(NO_BRANCHES, NO_BRANCHES);
}

public BranchFilter(String blacklistOption, String whitelistOption) {
this.blacklistedBranches = new BranchMatcher(blacklistOption, BranchMatcher.Mode.FAIL_EMPTY);
this.whitelistedBrandches = new BranchMatcher(whitelistOption, BranchMatcher.Mode.PASS_EMPTY);
this.whitelistedBranches = new BranchMatcher(whitelistOption, BranchMatcher.Mode.PASS_EMPTY);
}

public boolean isBranchValid(String branch) {
if (branch == null) {
return false;
} else if (whitelistedBrandches.isEmpty() && blacklistedBranches.isEmpty()) {
} else if (whitelistedBranches.isEmpty() && blacklistedBranches.isEmpty()) {
return true;
} else if (whitelistedBrandches.matches(branch) && !blacklistedBranches.matches(branch)) {
} else if (whitelistedBranches.matches(branch) && !blacklistedBranches.matches(branch)) {
return true;
} else {
return false;
Expand Down