Class GitSCMSourceDefaults

All Implemented Interfaces:
Describable<GitSCMExtension>

public class GitSCMSourceDefaults extends GitSCMExtension
Used to reset the default clone behaviour for GitSCM instances created by GitSCMBuilder. Does not have a descriptor as we do not expect this extension to be user-visible. With this extension, we anticipate:
  • tags will not be cloned or fetched
  • refspecs will be honoured on clone
Since:
3.4.0
  • Constructor Details

    • GitSCMSourceDefaults

      public GitSCMSourceDefaults(boolean includeTags)
      Constructor.
      Parameters:
      includeTags - true to request fetching tags.
  • Method Details

    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • decorateCloneCommand

      public void decorateCloneCommand(GitSCM scm, Run<?,?> build, org.jenkinsci.plugins.gitclient.GitClient git, TaskListener listener, org.jenkinsci.plugins.gitclient.CloneCommand cmd) throws IOException, InterruptedException, hudson.plugins.git.GitException
      Called before a CloneCommand is executed to allow extensions to alter its behaviour.
      Overrides:
      decorateCloneCommand in class GitSCMExtension
      Parameters:
      scm - GitSCM object
      build - run context
      git - GitClient
      listener - build log
      cmd - clone command to be decorated
      Throws:
      IOException - on input or output error
      InterruptedException - when interrupted
      hudson.plugins.git.GitException - on git error
    • decorateFetchCommand

      @Deprecated public void decorateFetchCommand(GitSCM scm, org.jenkinsci.plugins.gitclient.GitClient git, TaskListener listener, org.jenkinsci.plugins.gitclient.FetchCommand cmd) throws IOException, InterruptedException, hudson.plugins.git.GitException
      Deprecated.
      Called before a FetchCommand is executed to allow extensions to alter its behaviour.
      Overrides:
      decorateFetchCommand in class GitSCMExtension
      Parameters:
      scm - GitSCM object
      git - GitClient
      listener - build log
      cmd - fetch command to be decorated
      Throws:
      IOException - on input or output error
      InterruptedException - when interrupted
      hudson.plugins.git.GitException - on git error