public class JGitUtils extends Object
| Constructor and Description |
|---|
JGitUtils() |
| Modifier and Type | Method and Description |
|---|---|
static Date |
getAuthorDate(org.eclipse.jgit.revwalk.RevCommit commit)
Retrieves a Java Date from a Git commit.
|
static org.eclipse.jgit.lib.ObjectId |
getDefaultBranch(org.eclipse.jgit.lib.Repository repository)
Returns the default branch to use for a repository.
|
static List<RefModel> |
getLocalBranches(org.eclipse.jgit.lib.Repository repository,
boolean fullName,
int maxCount)
Returns the list of local branches in the repository.
|
static List<org.eclipse.jgit.revwalk.RevCommit> |
getRevLog(org.eclipse.jgit.lib.Repository repository,
String objectId,
Date minimumDate)
Returns a list of commits since the minimum date starting from the
specified object id.
|
static boolean |
hasCommits(org.eclipse.jgit.lib.Repository repository)
Determine if a repository has any commits.
|
public static List<org.eclipse.jgit.revwalk.RevCommit> getRevLog(org.eclipse.jgit.lib.Repository repository, String objectId, Date minimumDate)
repository - The Git repository to scanobjectId - if unspecified, HEAD is assumed.minimumDate - The date to scan back through the git logpublic static boolean hasCommits(org.eclipse.jgit.lib.Repository repository)
repository - The Git repository to scanpublic static org.eclipse.jgit.lib.ObjectId getDefaultBranch(org.eclipse.jgit.lib.Repository repository)
throws Exception
repository - The Git repository to scanException - If there is a file issuepublic static List<RefModel> getLocalBranches(org.eclipse.jgit.lib.Repository repository, boolean fullName, int maxCount)
repository - The Git repository to scanfullName - if true, /refs/heads/yadayadayada is returned. If false,
yadayadayada is returned.maxCount - if < 0, all local branches are returnedpublic static Date getAuthorDate(org.eclipse.jgit.revwalk.RevCommit commit)
commit - The commit to examineCopyright © 2017. All rights reserved.