@@ -275,45 +275,13 @@ private String defaultedVersionSCM(@NonNull Run<?, ?> run, @NonNull TaskListener
275
275
}
276
276
}
277
277
278
- if (scm0 == null ) {
279
- // WARNING: the WorkflowJob.getSCMs() does not return SCMs
280
- // associated with the current build configuration, but
281
- // rather those that were associated with previous runs
282
- // for different branches (with lastSuccessfulBuild on top)!
283
- BranchJobProperty property = ((WorkflowJob )runParent ).getProperty (BranchJobProperty .class );
284
- if (property == null ) { // && !(runParent.getParent() instanceof SCMSourceOwner)) {
285
- if (logger != null ) {
286
- logger .println ("defaultedVersion(): " +
287
- "WorkflowJob '" +
288
- runParent .getClass ().getName () +
289
- "' is not associated with any SCMs" );
290
- }
291
- } else {
292
- Branch pipelineBranch = property .getBranch ();
293
- if (logger != null ) {
294
- logger .println ("defaultedVersion(): " +
295
- "inspecting WorkflowJob '" +
296
- runParent .getClass ().getName () +
297
- "' for SCMs it might use" );
298
- }
299
- if (pipelineBranch != null ) {
300
- if (logger != null ) {
301
- logger .println ("defaultedVersion(): inspecting pipelineBranch '" +
302
- pipelineBranch .getClass ().getName () +
303
- "': " + pipelineBranch .toString ());
304
- }
305
- /*
306
- if ("hudson.plugins.git.GitSCM".equals(scmN.getClass().getName())) {
307
- // The best we can do here is accept
308
- // the first seen SCM (with branch
309
- // support which we know how to query).
310
- scm0 = scmN;
311
- break;
312
- }
313
- */
314
- }
315
- }
316
- }
278
+ // WARNING: the WorkflowJob.getSCMs() does not return SCMs
279
+ // associated with the current build configuration, but
280
+ // rather those that were associated with previous runs
281
+ // for different branches (with lastSuccessfulBuild on
282
+ // top), so we should not fall back looking at those!
283
+ // And we inspect (MBP) BranchJobProperty early in the
284
+ // main defaultedVersion() method.
317
285
} // if (runParent != null && runParent instanceof WorkflowJob)
318
286
319
287
// If no hit with runParent, look into the run itself:
0 commit comments