Package com.github.gastaldi.git.impl
Class GitWrapperImpl
java.lang.Object
com.github.gastaldi.git.impl.GitWrapperImpl
- All Implemented Interfaces:
GitWrapper
public class GitWrapperImpl extends java.lang.Object implements GitWrapper
- Author:
- Lukas Zaruba, lukas.zaruba@lundegaard.eu, 2019
-
Constructor Summary
Constructors Constructor Description GitWrapperImpl() -
Method Summary
Modifier and Type Method Description GitWrapperaddRemote(java.lang.String remote)Adds remote named originGitWrapperclean()Deletes .git directory in given path removing traces that this was ever a git repositoryGitWrapperconfigureSparseCheckout(java.util.List<java.lang.String> paths)Configures repository to do sparse checkout populating configuration with given checkout pathsGitWrapperensureDirectory()Checks whether the pwd directory exists and creates if it doesn'tGitWrapperinitialize(java.nio.file.Path pwd)Initializes this wrapper with pwd.GitWrapperinitRepository()Initializes new git repository in given pathGitWrapperpull(java.lang.String branch)Performs git pull using origin remote and given branch
-
Constructor Details
-
GitWrapperImpl
public GitWrapperImpl()
-
-
Method Details
-
initialize
Description copied from interface:GitWrapperInitializes this wrapper with pwd. This method must be called before any other interaction- Specified by:
initializein interfaceGitWrapper
-
ensureDirectory
Description copied from interface:GitWrapperChecks whether the pwd directory exists and creates if it doesn't- Specified by:
ensureDirectoryin interfaceGitWrapper
-
initRepository
Description copied from interface:GitWrapperInitializes new git repository in given path- Specified by:
initRepositoryin interfaceGitWrapper
-
addRemote
Description copied from interface:GitWrapperAdds remote named origin- Specified by:
addRemotein interfaceGitWrapper
-
configureSparseCheckout
Description copied from interface:GitWrapperConfigures repository to do sparse checkout populating configuration with given checkout paths- Specified by:
configureSparseCheckoutin interfaceGitWrapper
-
pull
Description copied from interface:GitWrapperPerforms git pull using origin remote and given branch- Specified by:
pullin interfaceGitWrapper
-
clean
Description copied from interface:GitWrapperDeletes .git directory in given path removing traces that this was ever a git repository- Specified by:
cleanin interfaceGitWrapper
-