Class AbstractGitRepository
java.lang.Object
com.github.koraktor.mavanagaiata.git.AbstractGitRepository
- All Implemented Interfaces:
GitRepository
,AutoCloseable
- Direct Known Subclasses:
JGitRepository
An abstract implementation of a Git repository that provides basic and
common functionality
- Author:
- Sebastian Staudt
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the abbreviated commit SHA ID of the current Git commitReturns aMailMap
object that holds information from Git's.mailmap
filevoid
setHeadRef
(String headRef) Sets the Git ref to use as theHEAD
commit of the repositoryMethods 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
-
Field Details
-
headRef
-
-
Constructor Details
-
AbstractGitRepository
public AbstractGitRepository()
-
-
Method Details
-
getAbbreviatedCommitId
Description copied from interface:GitRepository
Returns the abbreviated commit SHA ID of the current Git commit- Specified by:
getAbbreviatedCommitId
in interfaceGitRepository
- Returns:
- The abbreviated commit ID of the current
HEAD
commit - Throws:
GitRepositoryException
- if the abbreviated commit ID cannot be determined
-
getMailMap
Description copied from interface:GitRepository
Returns aMailMap
object that holds information from Git's.mailmap
file- Specified by:
getMailMap
in interfaceGitRepository
- Returns:
- A
.mailmap
representation ornull
if none exits - Throws:
GitRepositoryException
- if the.mailmap
file cannot be read or parsed
-
setHeadRef
Description copied from interface:GitRepository
Sets the Git ref to use as theHEAD
commit of the repository- Specified by:
setHeadRef
in interfaceGitRepository
- Parameters:
headRef
- The ref to use asHEAD
-