public class GitUtils extends Object implements Serializable
| Constructor and Description |
|---|
GitUtils(TaskListener listener,
org.jenkinsci.plugins.gitclient.GitClient git) |
public GitUtils(@NonNull
TaskListener listener,
@NonNull
org.jenkinsci.plugins.gitclient.GitClient git)
@CheckForNull public static hudson.plugins.git.GitTool resolveGitTool(@CheckForNull String gitTool, @CheckForNull Node builtOn, @CheckForNull EnvVars env, @NonNull TaskListener listener)
gitTool - Tool name. If null, default tool will be used (if exists)builtOn - Node for which the tool should be resolved
Can be Jenkins.getInstance() when running on controllerenv - Additional environment variableslistener - Event listenernull if it cannot be resolved@CheckForNull public static hudson.plugins.git.GitTool resolveGitTool(@CheckForNull String gitTool, @NonNull TaskListener listener)
resolveGitTool(String, Node, EnvVars, TaskListener) when the node is knowngitTool - Tool name. If null, default tool will be used (if exists)listener - Event listenernull if it cannot be resolvedpublic Collection<hudson.plugins.git.Revision> getAllBranchRevisions() throws hudson.plugins.git.GitException, IOException, InterruptedException
IOException - on input or output errorhudson.plugins.git.GitException - on git errorInterruptedException - when interruptedpublic hudson.plugins.git.Revision getRevisionContainingBranch(String branchName) throws hudson.plugins.git.GitException, IOException, InterruptedException
branchName - name of branch to be searchedIOException - on input or output errorhudson.plugins.git.GitException - on git errorInterruptedException - when interruptedpublic hudson.plugins.git.Revision getRevisionForSHA1(org.eclipse.jgit.lib.ObjectId sha1) throws hudson.plugins.git.GitException, IOException, InterruptedException
public hudson.plugins.git.Revision sortBranchesForRevision(hudson.plugins.git.Revision revision, List<BranchSpec> branchOrder)
public hudson.plugins.git.Revision sortBranchesForRevision(hudson.plugins.git.Revision revision, List<BranchSpec> branchOrder, EnvVars env)
@WithBridgeMethods(value=java.util.Collection.class) public List<hudson.plugins.git.Revision> filterTipBranches(Collection<hudson.plugins.git.Revision> revisions) throws InterruptedException
revisions - branches to be included in the search for tip branchesInterruptedException - when interruptedpublic static EnvVars getPollEnvironment(AbstractProject p, FilePath ws, Launcher launcher, TaskListener listener) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic static EnvVars getPollEnvironment(AbstractProject p, FilePath ws, Launcher launcher, TaskListener listener, boolean reuseLastBuildEnv) throws IOException, InterruptedException
p - abstract project to be consideredws - workspace to be consideredlauncher - launcher to use for calls to nodeslistener - build logreuseLastBuildEnv - true if last build environment should be consideredIOException - on input or output errorInterruptedException - when interruptedCopyright © 2007–2021. All rights reserved.