public abstract class RepositoryUtils extends Object
This class provides helpers for getting the branches, tags, and note references in a repository.
This class also provides helpers for knowing which references differ between a local and remote repository.
| Modifier and Type | Class and Description |
|---|---|
static class |
RepositoryUtils.RefDiff
Wrapper class for a remote and local ref that are different
|
| Constructor and Description |
|---|
RepositoryUtils() |
| Modifier and Type | Method and Description |
|---|---|
static Collection<RepositoryUtils.RefDiff> |
diffOriginRefs(org.eclipse.jgit.lib.Repository repository)
List the origin remote references and return all remote references that
are missing locally or have a different remote object id than the local
reference.
|
static Collection<RepositoryUtils.RefDiff> |
diffRemoteRefs(org.eclipse.jgit.lib.Repository repository,
String remote)
List remote references and return all remote references that are missing
locally or have a different remote object id than the local reference.
|
static Collection<String> |
getBranches(org.eclipse.jgit.lib.Repository repository)
Get all the local and remote tracking branch references in the given
repository.
|
static Collection<String> |
getNoteRefs(org.eclipse.jgit.lib.Repository repository)
Get all the note references in the given repository.
|
protected static Collection<org.eclipse.jgit.lib.Ref> |
getRefs(org.eclipse.jgit.lib.Repository repository,
String prefix)
Get the refs with prefix in repository
|
static Collection<String> |
getTags(org.eclipse.jgit.lib.Repository repository)
Get all the tag references in the given repository.
|
protected static boolean |
hasRemote(org.eclipse.jgit.lib.Repository repository,
String remote)
Does the given remote exist in the repository?
|
static Map<String,Set<String>> |
mapEmailsToNames(Collection<org.eclipse.jgit.lib.PersonIdent> persons)
Map e-mail addresses to names for all given
PersonIdent instances |
static Map<String,Set<String>> |
mapNamesToEmails(Collection<org.eclipse.jgit.lib.PersonIdent> persons)
Map names to e-mail addresses for all given
PersonIdent instances |
protected static Collection<org.eclipse.jgit.lib.Ref> getRefs(org.eclipse.jgit.lib.Repository repository, String prefix)
repository - prefix - public static Collection<String> getNoteRefs(org.eclipse.jgit.lib.Repository repository)
repository - public static Collection<String> getBranches(org.eclipse.jgit.lib.Repository repository)
repository - public static Collection<String> getTags(org.eclipse.jgit.lib.Repository repository)
repository - public static Collection<RepositoryUtils.RefDiff> diffOriginRefs(org.eclipse.jgit.lib.Repository repository)
repository - RepositoryUtils.RefDiffprotected static boolean hasRemote(org.eclipse.jgit.lib.Repository repository,
String remote)
throws URISyntaxException
repository - remote - URISyntaxExceptionpublic static Collection<RepositoryUtils.RefDiff> diffRemoteRefs(org.eclipse.jgit.lib.Repository repository, String remote)
repository - remote - RepositoryUtils.RefDiffpublic static Map<String,Set<String>> mapNamesToEmails(Collection<org.eclipse.jgit.lib.PersonIdent> persons)
PersonIdent instances
PersonIdent entries with a null or empty name will be ignored.
persons - PersonIdent.getName(),
PersonIdent.getEmailAddress()public static Map<String,Set<String>> mapEmailsToNames(Collection<org.eclipse.jgit.lib.PersonIdent> persons)
PersonIdent instances
PersonIdent entries with a null or empty e-mail address will be
ignored.
persons - PersonIdent.getName(),
PersonIdent.getEmailAddress()Copyright © 2011-2016. All Rights Reserved.