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.
|
class |
InMemoryRepository.MemObjDatabase
DfsObjDatabase used by InMemoryRepository.
|
protected class |
InMemoryRepository.MemRefDatabase
A ref database storing all refs in-memory.
|
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() |
RefDatabase |
getRefDatabase() |
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, getReflogReader, notifyIndexChanged, scanForRepoChanges
autoGC, close, create, doClose, exactRef, findRef, fireEvent, getAdditionalHaves, getAllRefs, getAllRefsByPeeledObjectId, getBranch, getDirectory, getFS, getFullBranch, getGlobalListenerList, getIndexFile, getListenerList, getRef, 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
- @Nullable public String getGitwebDescription()
Repository
GIT_DIR/description
file for gitweb.getGitwebDescription
in class Repository
public void setGitwebDescription(@Nullable String d)
Repository
GIT_DIR/description
file for gitweb.setGitwebDescription
in class Repository
d
- new description; null to clear the description.Copyright © 2017 Eclipse JGit Project. All rights reserved.