public class GitUtils extends Object
| Constructor and Description |
|---|
GitUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getTimestamp(java.time.Instant commitInstant)
Builds a string representing the given instant interpolated in the current system timezone
|
static boolean |
isAnnotated(org.eclipse.jgit.lib.Ref ref) |
static boolean |
isDetachedHead(org.eclipse.jgit.lib.Repository repository) |
static boolean |
isDirty(org.eclipse.jgit.api.Git git)
Checks that underlying repository is dirty (modified with uncommitted changes).
|
static Optional<String> |
providedBranchName()
Provide the branch name externally provided in case we are building on a detached branch.
|
static String |
sanitizeBranchName(String currentBranch) |
static String |
tagNameFromRef(org.eclipse.jgit.lib.Ref tag) |
public static String tagNameFromRef(org.eclipse.jgit.lib.Ref tag)
public static boolean isAnnotated(org.eclipse.jgit.lib.Ref ref)
public static boolean isDetachedHead(org.eclipse.jgit.lib.Repository repository)
throws IOException
IOExceptionpublic static boolean isDirty(org.eclipse.jgit.api.Git git)
throws org.eclipse.jgit.errors.NoWorkTreeException,
org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.GitAPIException - if a git eeror occured while computing statusorg.eclipse.jgit.errors.NoWorkTreeException - if the underlying repsoitory directory is not git managedpublic static String getTimestamp(java.time.Instant commitInstant)
commitInstant - commit time as an Instantpublic static Optional<String> providedBranchName()
Copyright © 2016–2018 Matthieu Brouillard. All rights reserved.