use of jenkins.plugins.git.traits.BranchDiscoveryTrait in project blueocean-plugin by jenkinsci.
the class GitPipelineCreateRequest method createSource.
@Override
protected SCMSource createSource(@Nonnull MultiBranchProject project, @Nonnull BlueScmConfig scmConfig) {
GitSCMSource gitSource = new GitSCMSource(StringUtils.defaultString(scmConfig.getUri()));
gitSource.setCredentialsId(computeCredentialId(scmConfig));
List<SCMSourceTrait> traits = gitSource.getTraits();
traits.add(new BranchDiscoveryTrait());
traits.add(new CleanBeforeCheckoutTrait());
traits.add(new CleanAfterCheckoutTrait());
traits.add(new LocalBranchTrait());
return gitSource;
}
Aggregations