Class AbstractGitRepository
- java.lang.Object
-
- com.github.koraktor.mavanagaiata.git.AbstractGitRepository
-
- All Implemented Interfaces:
GitRepository,AutoCloseable
- Direct Known Subclasses:
JGitRepository
public abstract class AbstractGitRepository extends Object implements GitRepository
An abstract implementation of a Git repository that provides basic and common functionality- Author:
- Sebastian Staudt
-
-
Constructor Summary
Constructors Constructor Description AbstractGitRepository()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAbbreviatedCommitId()Returns the abbreviated commit SHA ID of the current Git commitMailMapgetMailMap()Returns aMailMapobject that holds information from Git's.mailmapfilevoidsetHeadRef(String headRef)Sets the Git ref to use as theHEADcommit of the repository-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.github.koraktor.mavanagaiata.git.GitRepository
check, close, describe, getAbbreviatedCommitId, getBranch, getHeadCommit, getHeadRef, getTags, getWorkTree, isChecked, isDirty, isOnUnbornBranch, loadTag, walkCommits
-
-
-
-
Method Detail
-
getAbbreviatedCommitId
public String getAbbreviatedCommitId() throws GitRepositoryException
Description copied from interface:GitRepositoryReturns the abbreviated commit SHA ID of the current Git commit- Specified by:
getAbbreviatedCommitIdin interfaceGitRepository- Returns:
- The abbreviated commit ID of the current
HEADcommit - Throws:
GitRepositoryException- if the abbreviated commit ID cannot be determined
-
getMailMap
public MailMap getMailMap() throws GitRepositoryException
Description copied from interface:GitRepositoryReturns aMailMapobject that holds information from Git's.mailmapfile- Specified by:
getMailMapin interfaceGitRepository- Returns:
- A
.mailmaprepresentation ornullif none exits - Throws:
GitRepositoryException- if the.mailmapfile cannot be read or parsed
-
setHeadRef
public void setHeadRef(String headRef)
Description copied from interface:GitRepositorySets the Git ref to use as theHEADcommit of the repository- Specified by:
setHeadRefin interfaceGitRepository- Parameters:
headRef- The ref to use asHEAD
-
-