Commit 3b42ed38 authored by Tim Olshansky's avatar Tim Olshansky

Merge pull request #1 from Ebolon/merge-state

Fixed to check only merge request with state "closed" or "open". 
parents 840002c5 6f9248af
......@@ -104,11 +104,9 @@ public class GitlabAPI {
List<GitlabMergeRequest> openMergeRequests = new ArrayList<GitlabMergeRequest>();
for (GitlabMergeRequest mergeRequest : allMergeRequests) {
boolean closedState = (mergeRequest.getState() != null && mergeRequest.getState().equals("closed"));
if (closedState || mergeRequest.isClosed()) {
if (mergeRequest.isMerged() || mergeRequest.isClosed()) {
continue;
}
openMergeRequests.add(mergeRequest);
}
......
......@@ -100,5 +100,9 @@ public class GitlabMergeRequest {
public void setState(String state) {
_state = state;
if(state != null) {
_closed = state.equals("closed");
_merged = state.equals("merged");
}
}
}
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