public class InMemoryRepository extends DfsRepository
This implementation builds on the DFS repository by storing all reference and object data in the local process. It is not very efficient and exists only for unit testing and small experiments.
The repository is thread-safe. Memory used is released only when this object is garbage collected. Closing the repository has no impact on its memory.
Modifier and Type | Class and Description |
---|---|
static class |
InMemoryRepository.Builder
Builder for in-memory repositories.
|
static class |
InMemoryRepository.MemObjDatabase
DfsObjDatabase used by InMemoryRepository.
|
protected class |
InMemoryRepository.MemRefDatabase
DfsRefDatabase used by InMemoryRepository.
|
Constructor and Description |
---|
InMemoryRepository(DfsRepositoryDescription repoDesc)
Initialize a new in-memory repository.
|
Modifier and Type | Method and Description |
---|---|
String |
getGitwebDescription()
Read the
GIT_DIR/description file for gitweb. |
InMemoryRepository.MemObjDatabase |
getObjectDatabase()
Get the object database which stores this repository's data.
|
RefDatabase |
getRefDatabase()
Get the reference database which stores the reference namespace.
|
void |
setGitwebDescription(String d)
Set the
GIT_DIR/description file for gitweb. |
void |
setPerformsAtomicTransactions(boolean atomic)
Enable (or disable) the atomic reference transaction support.
|
create, createAttributesNodeProvider, exists, getConfig, getDescription, getIdentifier, getReflogReader, notifyIndexChanged, scanForRepoChanges
autoGC, close, create, doClose, exactRef, findRef, fireEvent, getAdditionalHaves, getAllRefs, getAllRefsByPeeledObjectId, getBranch, getDirectory, getFS, getFullBranch, getGlobalListenerList, getIndexFile, getListenerList, getRemoteName, getRemoteNames, getRepositoryState, getTags, getWorkTree, hasObject, incrementOpen, isBare, isValidRefName, lockDirCache, newObjectInserter, newObjectReader, normalizeBranchName, open, open, parseCommit, peel, readCherryPickHead, readCommitEditMsg, readDirCache, readMergeCommitMsg, readMergeHeads, readOrigHead, readRebaseTodo, readRevertHead, readSquashCommitMsg, renameRef, resolve, shortenRefName, shortenRemoteBranchName, simplify, stripWorkDir, toString, updateRef, updateRef, writeCherryPickHead, writeCommitEditMsg, writeMergeCommitMsg, writeMergeHeads, writeOrigHead, writeRebaseTodoFile, writeRevertHead, writeSquashCommitMsg
public InMemoryRepository(DfsRepositoryDescription repoDesc)
repoDesc
- description of the repository.public InMemoryRepository.MemObjDatabase getObjectDatabase()
getObjectDatabase
in class DfsRepository
public RefDatabase getRefDatabase()
getRefDatabase
in class Repository
public void setPerformsAtomicTransactions(boolean atomic)
Useful for testing atomic support enabled or disabled.
atomic
- whether to use atomic reference transaction support@Nullable public String getGitwebDescription()
GIT_DIR/description
file for gitweb.getGitwebDescription
in class Repository
public void setGitwebDescription(@Nullable String d)
GIT_DIR/description
file for gitweb.setGitwebDescription
in class Repository
d
- new description; null to clear the description.Copyright © 2019 Eclipse JGit Project. All rights reserved.