Skip to content

Commit e4d3ad3

Browse files
committed
StashBuildTrigger: Use isBuildable() instead of isDisabled()
The job field should be set at the time of the check. TODO: Test. What would happen if the trigger tries to start a disabled job?
1 parent 8747cbe commit e4d3ad3

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/main/java/stashpullrequestbuilder/stashpullrequestbuilder/StashBuildTrigger.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,14 +295,13 @@ private List<ParameterValue> getDefaultParameters() {
295295

296296
@Override
297297
public void run() {
298-
if (stashPullRequestsBuilder == null) {
298+
if (job == null || stashPullRequestsBuilder == null) {
299299
logger.info("Not ready to run.");
300300
return;
301301
}
302302

303-
AbstractProject project = stashPullRequestsBuilder.getProject();
304-
if (project.isDisabled()) {
305-
logger.fine(format("Project disabled, skipping build (%s).", project.getName()));
303+
if (job.isBuildable()) {
304+
logger.fine(format("Job is not buildable, skipping build (%s).", job.getName()));
306305
return;
307306
}
308307

0 commit comments

Comments
 (0)