@DataBoundConstructor public GitSCM( List<UserRemoteConfig> userRemoteConfigs, List<BranchSpec> branches, Boolean doGenerateSubmoduleConfigurations, Collection<SubmoduleConfig> submoduleCfg, @CheckForNull GitRepositoryBrowser browser, @CheckForNull String gitTool, List<GitSCMExtension> extensions) { // moved from createBranches this.branches = isEmpty(branches) ? newArrayList(new BranchSpec("*/master")) : branches; this.userRemoteConfigs = userRemoteConfigs; updateFromUserData(); // TODO: getBrowserFromRequest this.browser = browser; // emulate bindJSON behavior here if (doGenerateSubmoduleConfigurations != null) { this.doGenerateSubmoduleConfigurations = doGenerateSubmoduleConfigurations; } else { this.doGenerateSubmoduleConfigurations = false; } if (submoduleCfg == null) { submoduleCfg = new ArrayList<>(); } this.submoduleCfg = submoduleCfg; this.configVersion = 2L; this.gitTool = gitTool; this.extensions = new DescribableList<>(Saveable.NOOP,Util.fixNull(extensions)); getBuildChooser(); // set the gitSCM field. }
if (choosingStrategy != null && getBuildChooser().getClass()==DefaultBuildChooser.class) { for (BuildChooserDescriptor d : BuildChooser.all()) { if (choosingStrategy.equals(d.getLegacyId())) { getBuildChooser(); // set the gitSCM field.
private PollingResult compareRemoteRevisionWithImpl(Job<?, ?> project, Launcher launcher, FilePath workspace, final @NonNull TaskListener listener) throws IOException, InterruptedException { listener.getLogger().println("Using strategy: " + getBuildChooser().getDisplayName()); Collection<Revision> candidates = getBuildChooser().getCandidateRevisions( true, singleBranch, git, listener, buildData, new BuildChooserContextImpl(project, null, environment));
Collection<Revision> candidates = Collections.EMPTY_LIST; final BuildChooserContext context = new BuildChooserContextImpl(build.getParent(), build, environment); getBuildChooser().prepareWorkingTree(git, listener, context); final String singleBranch = environment.expand( getSingleBranch(environment) ); candidates = getBuildChooser().getCandidateRevisions( false, singleBranch, git, listener, buildData, context);
listener.getLogger().println("Using checkout strategy: " + getBuildChooser().getDisplayName());
} else { for (Branch b : revToBuild.getBranches()) { Build lastRevWas = getBuildChooser().prevBuildForChangelog(b.getName(), previousBuildData, git, context); if (lastRevWas != null && lastRevWas.revision != null && git.isCommitInRepo(lastRevWas.getSHA1())) { changelog.excludes(lastRevWas.getSHA1());