public interface GitRepositoryManager
Implementations of this interface should be a Singleton and
registered in Guice so they are globally available within the server
environment.
| Modifier and Type | Method and Description |
|---|---|
org.eclipse.jgit.lib.Repository |
createRepository(com.google.gerrit.reviewdb.client.Project.NameKey name)
Create (and open) a repository by name.
|
java.lang.String |
getProjectDescription(com.google.gerrit.reviewdb.client.Project.NameKey name)
Read the
GIT_DIR/description file for gitweb. |
java.util.SortedSet<com.google.gerrit.reviewdb.client.Project.NameKey> |
list() |
org.eclipse.jgit.lib.Repository |
openMetadataRepository(com.google.gerrit.reviewdb.client.Project.NameKey name)
Open the repository storing metadata for the given project.
|
org.eclipse.jgit.lib.Repository |
openRepository(com.google.gerrit.reviewdb.client.Project.NameKey name)
Get (or open) a repository by name.
|
void |
setProjectDescription(com.google.gerrit.reviewdb.client.Project.NameKey name,
java.lang.String description)
Set the
GIT_DIR/description file for gitweb. |
org.eclipse.jgit.lib.Repository openRepository(com.google.gerrit.reviewdb.client.Project.NameKey name)
throws org.eclipse.jgit.errors.RepositoryNotFoundException,
java.io.IOException
name - the repository name, relative to the base directory.close()
when done to decrement the resource handle.org.eclipse.jgit.errors.RepositoryNotFoundException - the name does not denote an existing
repository.java.io.IOException - the name cannot be read as a repository.org.eclipse.jgit.lib.Repository createRepository(com.google.gerrit.reviewdb.client.Project.NameKey name)
throws RepositoryCaseMismatchException,
org.eclipse.jgit.errors.RepositoryNotFoundException,
java.io.IOException
If the implementation supports separate metadata repositories, this method must also create the metadata repository, but does not open it.
name - the repository name, relative to the base directory.close()
when done to decrement the resource handle.RepositoryCaseMismatchException - the name collides with an existing
repository name, but only in case of a character within the name.org.eclipse.jgit.errors.RepositoryNotFoundException - the name is invalid.java.io.IOException - the repository cannot be created.org.eclipse.jgit.lib.Repository openMetadataRepository(com.google.gerrit.reviewdb.client.Project.NameKey name)
throws org.eclipse.jgit.errors.RepositoryNotFoundException,
java.io.IOException
This includes any project-specific metadata except what is stored
in refs/meta/config. Implementations may choose to store all
metadata in the original project.
name - the base project name name.close() when done to decrement the resource handle.org.eclipse.jgit.errors.RepositoryNotFoundException - the name does not denote an existing
repository.java.io.IOException - the name cannot be read as a repository.java.util.SortedSet<com.google.gerrit.reviewdb.client.Project.NameKey> list()
java.lang.String getProjectDescription(com.google.gerrit.reviewdb.client.Project.NameKey name)
throws org.eclipse.jgit.errors.RepositoryNotFoundException,
java.io.IOException
GIT_DIR/description file for gitweb.
NB: This code should really be in JGit, as a member of the Repository object. Until it moves there, its here.
name - the repository name, relative to the base directory.org.eclipse.jgit.errors.RepositoryNotFoundException - the named repository does not exist.java.io.IOException - the description file exists, but is not readable by
this process.void setProjectDescription(com.google.gerrit.reviewdb.client.Project.NameKey name,
java.lang.String description)
GIT_DIR/description file for gitweb.
NB: This code should really be in JGit, as a member of the Repository object. Until it moves there, its here.
name - the repository name, relative to the base directory.description - new description text for the repository.