Class DfsRepository
- java.lang.Object
-
- org.eclipse.jgit.lib.Repository
-
- org.eclipse.jgit.internal.storage.dfs.DfsRepository
-
- Direct Known Subclasses:
InMemoryRepository
public abstract class DfsRepository extends Repository
A Git repository on a DFS.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DfsRepository(DfsRepositoryBuilder builder)
Initialize a DFS repository.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
create(boolean bare)
Create a new Git repository initializing the necessary files and directories.boolean
exists()
Check if the repository already exists.StoredConfig
getConfig()
DfsRepositoryDescription
getDescription()
abstract DfsObjDatabase
getObjectDatabase()
abstract DfsRefDatabase
getRefDatabase()
ReflogReader
getReflogReader(java.lang.String refName)
void
notifyIndexChanged()
Notify that the index changedvoid
scanForRepoChanges()
Force a scan for changed refs.-
Methods inherited from class org.eclipse.jgit.lib.Repository
close, create, doClose, fireEvent, getAdditionalHaves, getAllRefs, getAllRefsByPeeledObjectId, getBranch, getDirectory, getFS, getFullBranch, getGlobalListenerList, getIndexFile, getListenerList, getRef, getRemoteName, getRemoteNames, getRepositoryState, getTags, getWorkTree, hasObject, incrementOpen, isBare, isValidRefName, lockDirCache, newObjectInserter, newObjectReader, open, open, peel, readCherryPickHead, readDirCache, readMergeCommitMsg, readMergeHeads, readOrigHead, readRebaseTodo, readRevertHead, readSquashCommitMsg, renameRef, resolve, shortenRefName, shortenRemoteBranchName, simplify, stripWorkDir, toString, updateRef, updateRef, writeCherryPickHead, writeMergeCommitMsg, writeMergeHeads, writeOrigHead, writeRebaseTodoFile, writeRevertHead, writeSquashCommitMsg
-
-
-
-
Constructor Detail
-
DfsRepository
protected DfsRepository(DfsRepositoryBuilder builder)
Initialize a DFS repository.- Parameters:
builder
- description of the repository.
-
-
Method Detail
-
getObjectDatabase
public abstract DfsObjDatabase getObjectDatabase()
- Specified by:
getObjectDatabase
in classRepository
- Returns:
- the object database which stores this repository's data.
-
getRefDatabase
public abstract DfsRefDatabase getRefDatabase()
- Specified by:
getRefDatabase
in classRepository
- Returns:
- the reference database which stores the reference namespace.
-
getDescription
public DfsRepositoryDescription getDescription()
- Returns:
- a description of this repository.
-
exists
public boolean exists() throws java.io.IOException
Check if the repository already exists.- Returns:
- true if the repository exists; false if it is new.
- Throws:
java.io.IOException
- the repository cannot be checked.
-
create
public void create(boolean bare) throws java.io.IOException
Description copied from class:Repository
Create a new Git repository initializing the necessary files and directories.- Specified by:
create
in classRepository
- Parameters:
bare
- if true, a bare repository (a repository without a working directory) is created.- Throws:
java.io.IOException
- in case of IO problem
-
getConfig
public StoredConfig getConfig()
- Specified by:
getConfig
in classRepository
- Returns:
- the configuration of this repository
-
scanForRepoChanges
public void scanForRepoChanges() throws java.io.IOException
Description copied from class:Repository
Force a scan for changed refs.- Specified by:
scanForRepoChanges
in classRepository
- Throws:
java.io.IOException
-
notifyIndexChanged
public void notifyIndexChanged()
Description copied from class:Repository
Notify that the index changed- Specified by:
notifyIndexChanged
in classRepository
-
getReflogReader
public ReflogReader getReflogReader(java.lang.String refName) throws java.io.IOException
- Specified by:
getReflogReader
in classRepository
- Returns:
- a
ReflogReader
for the supplied refname, or null if the named ref does not exist. - Throws:
java.io.IOException
- the ref could not be accessed.
-
-