hudson.plugins.git.SubmoduleConfig Java Examples

The following examples show how to use hudson.plugins.git.SubmoduleConfig. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ScmFactoryImpl.java    From aws-codecommit-trigger-plugin with Apache License 2.0 5 votes vote down vote up
public GitSCM createGit(String url, List<BranchSpec> branchSpecs) {
    return new GitSCM(
        GitSCM.createRepoList(url, null),
        branchSpecs,
        false,
        Collections.<SubmoduleConfig>emptyList(),
        null,
        null,
        Collections.<GitSCMExtension>emptyList()
    );
}
 
Example #2
Source File: MockGitSCM.java    From aws-codecommit-trigger-plugin with Apache License 2.0 5 votes vote down vote up
@DataBoundConstructor
public MockGitSCM(
    List<UserRemoteConfig> userRemoteConfigs,
    List<BranchSpec> branches,
    Boolean doGenerateSubmoduleConfigurations,
    Collection<SubmoduleConfig> submoduleCfg,
    GitRepositoryBrowser browser,
    String gitTool,
    List<GitSCMExtension> extensions
) {
    super(userRemoteConfigs, branches, doGenerateSubmoduleConfigurations, submoduleCfg, browser, gitTool, extensions);
    this.url = userRemoteConfigs.get(0).getUrl();
}
 
Example #3
Source File: MockGitSCM.java    From aws-codecommit-trigger-plugin with Apache License 2.0 5 votes vote down vote up
public static MockGitSCM fromUrlAndBranchSpecs(String url, List<BranchSpec> branchSpecs) {
    return new MockGitSCM(
        GitSCM.createRepoList(url, null),
        branchSpecs,
        false,
        Collections.<SubmoduleConfig>emptyList(),
        null,
        null,
        Collections.<GitSCMExtension>emptyList()
    );
}
 
Example #4
Source File: GitLabSCMHeadImpl.java    From gitlab-branch-source-plugin with GNU General Public License v2.0 5 votes vote down vote up
@Nonnull
public final GitSCM createSCM(GitLabSCMSource source) {
    try {
        return new GitSCM(getRemotes(source), getBranchSpecs(),
                false, Collections.<SubmoduleConfig>emptyList(),
                getBrowser(source.getProjectId(), source), null, getExtensions(source));
    } catch (Exception e) {
        throw new RuntimeException("error creating scm for source + " + source.getId(), e);
    }
}
 
Example #5
Source File: PushHookTriggerHandlerGitlabServerTest.java    From gitlab-plugin with GNU General Public License v2.0 5 votes vote down vote up
@Theory
public void createRevisionParameterAction_pushCommitRequestWith2Remotes(GitLabPushRequestSamples samples) throws Exception {
    PushHook hook = samples.pushCommitRequest();

    GitSCM gitSCM = new GitSCM(Arrays.asList(new UserRemoteConfig("[email protected]:test.git", null, null, null),
                                             new UserRemoteConfig("[email protected]:fork.git", "fork", null, null)),
                               Collections.singletonList(new BranchSpec("")),
                               false, Collections.<SubmoduleConfig>emptyList(),
                               null, null, null);
    RevisionParameterAction revisionParameterAction = new PushHookTriggerHandlerImpl(false).createRevisionParameter(hook, gitSCM);

    assertThat(revisionParameterAction, is(notNullValue()));
    assertThat(revisionParameterAction.commit, is(hook.getAfter()));
    assertFalse(revisionParameterAction.canOriginateFrom(new ArrayList<RemoteConfig>()));
}