Class GitRepository

  • All Implemented Interfaces:
    Closeable, AutoCloseable

    public class GitRepository
    extends Object
    implements Closeable
    Abstraction over a git repository.
    Author:
    Emmanuel Hugonnet (c) 2017 Red Hat, inc.
    • Method Detail

      • getGit

        public org.eclipse.jgit.api.Git getGit()
      • getDirectory

        public File getDirectory()
      • isBare

        public boolean isBare()
      • getPattern

        public String getPattern​(File file)
      • getPattern

        public String getPattern​(Path file)
      • getBranch

        public String getBranch()
      • isValidRemoteName

        public final boolean isValidRemoteName​(String remoteName)
      • getRemoteName

        public final String getRemoteName​(String gitRepository)
      • rollback

        public void rollback()
                      throws org.eclipse.jgit.api.errors.GitAPIException
        Reset hard on HEAD.
        Throws:
        org.eclipse.jgit.api.errors.GitAPIException
      • commit

        public void commit​(String msg)
                    throws org.eclipse.jgit.api.errors.GitAPIException
        Commit all changes if there are uncommitted changes.
        Parameters:
        msg - the commit message.
        Throws:
        org.eclipse.jgit.api.errors.GitAPIException