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 @@ -43,6 +43,8 @@
public class CppcheckResult implements Serializable {

private static final long serialVersionUID = 1L;
private static final String PULL_REQUEST_TO_HASH = "PULL_REQUEST_TO_HASH";
private static final String GIT_COMMIT = "GIT_COMMIT";

/**
* The Cppcheck report
Expand Down Expand Up @@ -157,6 +159,18 @@ public CppcheckResult getPreviousResult() {
* @return the previous Cppcheck Build Action
*/
private CppcheckBuildAction getPreviousAction() {
String pull_request_to_hash = owner.getBuildVariables().get(PULL_REQUEST_TO_HASH);
if (pull_request_to_hash != null) {
AbstractBuild<?, ?> lOwner = owner.getPreviousBuild();
while (lOwner != null) {
String commit_hash = lOwner.getBuildVariables().get(GIT_COMMIT);
if (pull_request_to_hash.equals(commit_hash)) {
return lOwner.getAction(CppcheckBuildAction.class);
}
lOwner = lOwner.getPreviousBuild();
}
}

AbstractBuild<?, ?> previousBuild = owner.getPreviousBuild();
if (previousBuild != null) {
return previousBuild.getAction(CppcheckBuildAction.class);
Expand Down