Class GitCheckOutCommand
- java.lang.Object
-
- org.apache.maven.scm.command.AbstractCommand
-
- org.apache.maven.scm.command.checkout.AbstractCheckOutCommand
-
- org.apache.maven.scm.provider.git.gitexe.command.checkout.GitCheckOutCommand
-
- All Implemented Interfaces:
Command,GitCommand
public class GitCheckOutCommand extends AbstractCheckOutCommand implements GitCommand
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,java.lang.String>environmentVariables-
Fields inherited from class org.apache.maven.scm.command.AbstractCommand
logger
-
-
Constructor Summary
Constructors Constructor Description GitCheckOutCommand(java.util.Map<java.lang.String,java.lang.String> environmentVariables)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private org.codehaus.plexus.util.cli.CommandlinecreateCloneCommand(GitScmProviderRepository repository, java.io.File workingDirectory, ScmVersion version, boolean binary, boolean shallow)Create a git-clone repository command.static org.codehaus.plexus.util.cli.CommandlinecreateCommandLine(GitScmProviderRepository repository, java.io.File workingDirectory, ScmVersion version)private org.codehaus.plexus.util.cli.CommandlinecreatePullCommand(GitScmProviderRepository repository, java.io.File workingDirectory, ScmVersion version)Create a git fetch or git pull repository command.protected CheckOutScmResultexecuteCheckOutCommand(ScmProviderRepository repo, ScmFileSet fileSet, ScmVersion version, boolean recursive, boolean shallow)The overriddenexecuteCommand(ScmProviderRepository, ScmFileSet, CommandParameters)in this class will not call this method!ScmResultexecuteCommand(ScmProviderRepository repo, ScmFileSet fileSet, CommandParameters parameters)For git, the given repository is a remote one.private voidforceBinary(org.codehaus.plexus.util.cli.Commandline commandLine, boolean binary)-
Methods inherited from class org.apache.maven.scm.command.checkout.AbstractCheckOutCommand
executeCheckOutCommand
-
Methods inherited from class org.apache.maven.scm.command.AbstractCommand
execute
-
-
-
-
Method Detail
-
executeCommand
public ScmResult executeCommand(ScmProviderRepository repo, ScmFileSet fileSet, CommandParameters parameters) 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.TODO We currently assume a '.git' directory, so this does not work for --bare repos
- Overrides:
executeCommandin classAbstractCheckOutCommand- Throws:
ScmException
-
createCommandLine
public static org.codehaus.plexus.util.cli.Commandline createCommandLine(GitScmProviderRepository repository, java.io.File workingDirectory, ScmVersion version)
-
createCloneCommand
private org.codehaus.plexus.util.cli.Commandline createCloneCommand(GitScmProviderRepository repository, java.io.File workingDirectory, ScmVersion version, boolean binary, boolean shallow)
Create a git-clone repository command.
-
forceBinary
private void forceBinary(org.codehaus.plexus.util.cli.Commandline commandLine, boolean binary)
-
createPullCommand
private org.codehaus.plexus.util.cli.Commandline createPullCommand(GitScmProviderRepository repository, java.io.File workingDirectory, ScmVersion version)
Create a git fetch or git pull repository command.
-
executeCheckOutCommand
protected CheckOutScmResult executeCheckOutCommand(ScmProviderRepository repo, ScmFileSet fileSet, ScmVersion version, boolean recursive, boolean shallow) throws ScmException
The overriddenexecuteCommand(ScmProviderRepository, ScmFileSet, CommandParameters)in this class will not call this method!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
-
-