Package com.xenoterracide.gradle.git
Interface GitMetadata
- All Known Implementing Classes:
GitMetadataImpl
public interface GitMetadata
Git Metadata interface to allow easy test stubbing with records.
-
Method Summary
Modifier and TypeMethodDescription@Nullable Stringbranch()Gets the current branch.@Nullable Stringcommit()Gets the current commit.longdistance()Gets commit distance.remotes()Gets the remotes.status()Gets status.@Nullable Stringtag()Gets latest tag.@Nullable StringShort version of a commit SHA.
-
Method Details
-
uniqueShort
@Nullable String uniqueShort()Short version of a commit SHA.- Returns:
- SHA. Length starts at 8 but may grow as repository does
-
tag
@Nullable String tag()Gets latest tag.- Returns:
- the latest tag
-
distance
long distance()Gets commit distance.- Returns:
- the commit distance
-
status
GitStatus status()Gets status.- Returns:
- the status
-
branch
@Nullable String branch()Gets the current branch.- Returns:
- the current branch
-
commit
@Nullable String commit()Gets the current commit.- Returns:
- the current commit
-
remotes
Gets the remotes.- Returns:
- the configured remotes or an empty list
-