Class JGitCheckOutCommand
java.lang.Object
org.apache.maven.scm.command.AbstractCommand
org.apache.maven.scm.command.checkout.AbstractCheckOutCommand
org.apache.maven.scm.provider.git.jgit.command.checkout.JGitCheckOutCommand
- All Implemented Interfaces:
Command, GitCommand, CustomizableSshSessionFactoryCommand
public class JGitCheckOutCommand
extends AbstractCheckOutCommand
implements GitCommand, CustomizableSshSessionFactoryCommand
- Since:
- 1.9
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate BiFunction<GitScmProviderRepository, org.slf4j.Logger, ScmProviderAwareSshdSessionFactory> Fields inherited from class AbstractCommand
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected CheckOutScmResultexecuteCheckOutCommand(ScmProviderRepository repo, ScmFileSet fileSet, ScmVersion version, boolean recursive, boolean shallow) For git, the given repository is a remote one.voidsetSshSessionFactorySupplier(BiFunction<GitScmProviderRepository, org.slf4j.Logger, ScmProviderAwareSshdSessionFactory> sshSessionFactorySupplier) Sets a different supplier for the SSH session factory that will be used by this command.Methods inherited from class AbstractCheckOutCommand
executeCheckOutCommand, executeCommandMethods inherited from class AbstractCommand
execute
-
Field Details
-
sshSessionFactorySupplier
private BiFunction<GitScmProviderRepository, org.slf4j.Logger, ScmProviderAwareSshdSessionFactory> sshSessionFactorySupplier
-
-
Constructor Details
-
JGitCheckOutCommand
public JGitCheckOutCommand()
-
-
Method Details
-
setSshSessionFactorySupplier
public void setSshSessionFactorySupplier(BiFunction<GitScmProviderRepository, org.slf4j.Logger, ScmProviderAwareSshdSessionFactory> sshSessionFactorySupplier) Description copied from interface:CustomizableSshSessionFactoryCommandSets a different supplier for the SSH session factory that will be used by this command. By default it usesScmProviderAwareSshdSessionFactory.- Specified by:
setSshSessionFactorySupplierin interfaceCustomizableSshSessionFactoryCommand- Parameters:
sshSessionFactorySupplier- a function that takes a GitScmProviderRepository and Logger and returns a ScmProviderAwareSshdSessionFactory
-
executeCheckOutCommand
protected CheckOutScmResult executeCheckOutCommand(ScmProviderRepository repo, ScmFileSet fileSet, ScmVersion version, boolean recursive, boolean shallow) throws ScmException For git, the given repository is a remote one. We have to clone it first if the working directory does not contain a git repo yet, otherwise we have to git-pull it.Execute Check out command line.
- Specified by:
executeCheckOutCommandin classAbstractCheckOutCommand- Parameters:
repo- not nullfileSet- not nullversion- not nullrecursive-trueif recursive check out is wanted,falseotherwiseshallow-trueif shallow check out is wanted,falseotherwise- Returns:
- the checkout result
- Throws:
ScmException- if any
-