Package org.jenkinsci.plugins.gitclient
Interface CloneCommand
-
- All Superinterfaces:
GitCommand
public interface CloneCommand extends GitCommand
Command to clone a repository. This command behaves differently from CLI clone command, it never actually checks out into the workspace.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description CloneCommanddepth(Integer depth)When shallow cloning, allow for a depth to be set in cases where you need more than the immediate last commit.CloneCommandnoCheckout()Deprecated.CloneCommandreference(String reference)reference.CloneCommandrefspecs(List<org.eclipse.jgit.transport.RefSpec> refspecs)List of refspecs to be retrieved by the fetch.CloneCommandrepositoryName(String name)Name of the remote, such as 'origin' (which is the default).CloneCommandshallow()Deprecated.favourshallow(boolean)CloneCommandshallow(boolean shallow)Only clone the most recent history, not preceding history.CloneCommandshared()Deprecated.favourshared(boolean)CloneCommandshared(boolean shared)When the repository to clone is on the local machine, instead of using hard links, automatically setup .git/objects/info/alternates to share the objects with the source repositoryCloneCommandtags(boolean tags)Boolean which allows caller to request that tags and their references are not fetched.CloneCommandtimeout(Integer timeout)timeout.CloneCommandurl(String url)URL of the repository to be cloned.-
Methods inherited from interface org.jenkinsci.plugins.gitclient.GitCommand
execute
-
-
-
-
Method Detail
-
url
CloneCommand url(String url)
URL of the repository to be cloned.- Parameters:
url- aStringobject.- Returns:
- a
CloneCommandobject.
-
repositoryName
CloneCommand repositoryName(String name)
Name of the remote, such as 'origin' (which is the default).- Parameters:
name- aStringobject.- Returns:
- a
CloneCommandobject.
-
shallow
@Deprecated CloneCommand shallow()
Deprecated.favourshallow(boolean)Only clone the most recent history, not preceding history. Depth of the shallow clone is controlled by the #depth method.- Returns:
- a
CloneCommandobject.
-
shallow
CloneCommand shallow(boolean shallow)
Only clone the most recent history, not preceding history. Depth of the shallow clone is controlled by the #depth method.- Parameters:
shallow- boolean controlling whether the clone is shallow- Returns:
- a
CloneCommandobject. - Since:
- 2.5.0
-
shared
@Deprecated CloneCommand shared()
Deprecated.favourshared(boolean)When the repository to clone is on the local machine, instead of using hard links, automatically setup .git/objects/info/alternates to share the objects with the source repository- Returns:
- a
CloneCommandobject.
-
shared
CloneCommand shared(boolean shared)
When the repository to clone is on the local machine, instead of using hard links, automatically setup .git/objects/info/alternates to share the objects with the source repository- Parameters:
shared- boolean controlling whether the clone is shared- Returns:
- a
CloneCommandobject. - Since:
- 2.5.0
-
reference
CloneCommand reference(String reference)
reference.- Parameters:
reference- aStringobject.- Returns:
- a
CloneCommandobject.
-
timeout
CloneCommand timeout(Integer timeout)
timeout.- Parameters:
timeout- aIntegerobject.- Returns:
- a
CloneCommandobject.
-
noCheckout
@Deprecated CloneCommand noCheckout()
Deprecated.When we just need to clone repository without populating the workspace (for instance when sparse checkouts are used). This parameter does not do anything, a checkout will never be performed.- Returns:
- a
CloneCommandobject.
-
tags
CloneCommand tags(boolean tags)
Boolean which allows caller to request that tags and their references are not fetched. Default is to fetch tags when cloning.- Parameters:
tags- boolean controlling whether tags are fetched- Returns:
- a
CloneCommandobject.
-
refspecs
CloneCommand refspecs(List<org.eclipse.jgit.transport.RefSpec> refspecs)
List of refspecs to be retrieved by the fetch.- Parameters:
refspecs- refspecs defining the references to be fetched- Returns:
- a
CloneCommandobject.
-
depth
CloneCommand depth(Integer depth)
When shallow cloning, allow for a depth to be set in cases where you need more than the immediate last commit. Has no effect if shallow is set to false (default).- Parameters:
depth- number of revisions to be included in shallow clone- Returns:
- a
CloneCommandobject.
-
-