Interface GitWrapper

All Known Implementing Classes:
GitWrapperImpl

public interface GitWrapper
Author:
Lukas Zaruba, lukas.zaruba@lundegaard.eu, 2019
  • Method Summary

    Modifier and Type Method Description
    GitWrapper addRemote​(java.lang.String remote)
    Adds remote named origin
    GitWrapper clean()
    Deletes .git directory in given path removing traces that this was ever a git repository
    GitWrapper configureSparseCheckout​(java.util.List<java.lang.String> paths)
    Configures repository to do sparse checkout populating configuration with given checkout paths
    GitWrapper ensureDirectory()
    Checks whether the pwd directory exists and creates if it doesn't
    GitWrapper initialize​(java.nio.file.Path pwd)
    Initializes this wrapper with pwd.
    GitWrapper initRepository()
    Initializes new git repository in given path
    GitWrapper pull​(java.lang.String branch)
    Performs git pull using origin remote and given branch
  • Method Details

    • initialize

      GitWrapper initialize​(java.nio.file.Path pwd)
      Initializes this wrapper with pwd. This method must be called before any other interaction
    • ensureDirectory

      GitWrapper ensureDirectory()
      Checks whether the pwd directory exists and creates if it doesn't
      Throws:
      java.lang.IllegalStateException - if there already is a .git directory inside the pwd
    • initRepository

      GitWrapper initRepository()
      Initializes new git repository in given path
    • addRemote

      GitWrapper addRemote​(java.lang.String remote)
      Adds remote named origin
    • configureSparseCheckout

      GitWrapper configureSparseCheckout​(java.util.List<java.lang.String> paths)
      Configures repository to do sparse checkout populating configuration with given checkout paths
    • pull

      GitWrapper pull​(java.lang.String branch)
      Performs git pull using origin remote and given branch
    • clean

      GitWrapper clean()
      Deletes .git directory in given path removing traces that this was ever a git repository