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 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.CloneCommand
noCheckout()
Deprecated.CloneCommand
reference(String reference)
reference.CloneCommand
refspecs(List<org.eclipse.jgit.transport.RefSpec> refspecs)
List of refspecs to be retrieved by the fetch.CloneCommand
repositoryName(String name)
Name of the remote, such as 'origin' (which is the default).CloneCommand
shallow()
Deprecated.favourshallow(boolean)
CloneCommand
shallow(boolean shallow)
Only clone the most recent history, not preceding history.CloneCommand
shared()
Deprecated.favourshared(boolean)
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 repositoryCloneCommand
tags(boolean tags)
Boolean which allows caller to request that tags and their references are not fetched.CloneCommand
timeout(Integer timeout)
timeout.CloneCommand
url(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
- aString
object.- Returns:
- a
CloneCommand
object.
-
repositoryName
CloneCommand repositoryName(String name)
Name of the remote, such as 'origin' (which is the default).- Parameters:
name
- aString
object.- Returns:
- a
CloneCommand
object.
-
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
CloneCommand
object.
-
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
CloneCommand
object. - 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
CloneCommand
object.
-
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
CloneCommand
object. - Since:
- 2.5.0
-
reference
CloneCommand reference(String reference)
reference.- Parameters:
reference
- aString
object.- Returns:
- a
CloneCommand
object.
-
timeout
CloneCommand timeout(Integer timeout)
timeout.- Parameters:
timeout
- aInteger
object.- Returns:
- a
CloneCommand
object.
-
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
CloneCommand
object.
-
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
CloneCommand
object.
-
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
CloneCommand
object.
-
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
CloneCommand
object.
-
-