From b562c93c10f808b6ceb10ae316e00dcaec50add6 Mon Sep 17 00:00:00 2001 From: Csaba Kozak Date: Wed, 11 May 2016 17:56:38 +0200 Subject: [PATCH] Fix finding related commit of the build --- .../dabsquared/gitlabjenkins/util/CommitStatusUpdater.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/dabsquared/gitlabjenkins/util/CommitStatusUpdater.java b/src/main/java/com/dabsquared/gitlabjenkins/util/CommitStatusUpdater.java index f263177..540e672 100644 --- a/src/main/java/com/dabsquared/gitlabjenkins/util/CommitStatusUpdater.java +++ b/src/main/java/com/dabsquared/gitlabjenkins/util/CommitStatusUpdater.java @@ -64,7 +64,9 @@ public class CommitStatusUpdater { } private static String getBuildRevision(Run build) { - return build.getAction(BuildData.class).getLastBuiltRevision().getSha1String(); + BuildData action = build.getAction(BuildData.class); + + return action.getLastBuild(action.getLastBuiltRevision().getSha1()).getMarked().getSha1String(); } private static boolean existsCommit(GitLabApi client, String gitlabProjectId, String commitHash) {