Commit 6f9248af authored by Simon Pizonka's avatar Simon Pizonka

Fixed to check only merge request with state "closed" or "open". Moved state...

Fixed to check only merge request with state "closed" or "open". Moved state parse to GitlabMergeRequest model.
parent 840002c5
......@@ -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