Class GitSCMSourceContext<C extends GitSCMSourceContext<C,​R>,​R extends GitSCMSourceRequest>

    • Constructor Detail

      • GitSCMSourceContext

        public GitSCMSourceContext​(@CheckForNull
                                   jenkins.scm.api.SCMSourceCriteria criteria,
                                   @NonNull
                                   jenkins.scm.api.SCMHeadObserver observer)
        Constructor.
        Parameters:
        criteria - (optional) criteria.
        observer - the SCMHeadObserver.
    • Method Detail

      • wantBranches

        public final boolean wantBranches()
        Returns true if the GitSCMSourceRequest will need information about branches.
        Returns:
        true if the GitSCMSourceRequest will need information about branches.
      • wantTags

        public final boolean wantTags()
        Returns true if the GitSCMSourceRequest will need information about tags.
        Returns:
        true if the GitSCMSourceRequest will need information about tags.
      • wantOtherRefs

        public final boolean wantOtherRefs()
        Returns true if the GitSCMSourceRequest will need information about other refs.
        Returns:
        true if the GitSCMSourceRequest will need information about other refs.
      • gitTool

        @CheckForNull
        public final String gitTool()
        Returns the name of the GitTool to use or null to use the default.
        Returns:
        the name of the GitTool to use or null to use the default.
      • ignoreOnPushNotifications

        public final boolean ignoreOnPushNotifications()
        Returns true if push notifications should be ignored.
        Returns:
        true if push notifications should be ignored.
      • refSpecs

        @NonNull
        public final List<String> refSpecs()
        Returns the list of ref specs to use.
        Returns:
        the list of ref specs to use.
      • remoteName

        @NonNull
        public final String remoteName()
        Returns the name to give the remote.
        Returns:
        the name to give the remote.
      • wantBranches

        @NonNull
        public C wantBranches​(boolean include)
        Adds a requirement for branch details to any GitSCMSourceRequest for this context.
        Parameters:
        include - true to add the requirement or false to leave the requirement as is (makes simpler with method chaining)
        Returns:
        this for method chaining.
      • wantTags

        @NonNull
        public C wantTags​(boolean include)
        Adds a requirement for tag details to any GitSCMSourceRequest for this context.
        Parameters:
        include - true to add the requirement or false to leave the requirement as is (makes simpler with method chaining)
        Returns:
        this for method chaining.
      • pruneRefs

        @NonNull
        public C pruneRefs​(boolean include)
        Adds a requirement for git ref pruning to any GitSCMSourceRequest for this context.
        Parameters:
        include - true to add the requirement or false to leave the requirement as is (makes simpler with method chaining)
        Returns:
        this for method chaining.
      • wantOtherRef

        @NonNull
        public C wantOtherRef​(GitSCMSourceContext.RefNameMapping other)
        Adds a requirement for details of additional refs to any GitSCMSourceRequest for this context.
        Parameters:
        other - The specification for that other ref
        Returns:
        this for method chaining.
      • withIgnoreOnPushNotifications

        @NonNull
        public final C withIgnoreOnPushNotifications​(boolean ignoreOnPushNotifications)
        Configures whether push notifications should be ignored.
        Parameters:
        ignoreOnPushNotifications - true to ignore push notifications.
        Returns:
        this for method chaining.
      • withoutRefSpecs

        @NonNull
        public final C withoutRefSpecs()
        Clears the specified ref specs. If no ref specs are subsequently defined then AbstractGitSCMSource.REF_SPEC_DEFAULT will be used as the ref spec template.
        Returns:
        this for method chaining.
      • withRemoteName

        @NonNull
        public final C withRemoteName​(String remoteName)
        Configures the remote name to use for the git repository.
        Parameters:
        remoteName - the remote name to use for the git repository (null or the empty string are equivalent to passing AbstractGitSCMSource.DEFAULT_REMOTE_NAME).
        Returns:
        this for method chaining.
      • asRefSpecs

        @NonNull
        public final List<org.eclipse.jgit.transport.RefSpec> asRefSpecs()
        Converts the ref spec templates into RefSpec instances.
        Returns:
        the list of RefSpec instances.