Class InMemoryRepository
- java.lang.Object
-
- org.eclipse.jgit.lib.Repository
-
- org.eclipse.jgit.internal.storage.dfs.DfsRepository
-
- org.eclipse.jgit.internal.storage.dfs.InMemoryRepository
-
public class InMemoryRepository extends DfsRepository
Git repository stored entirely in the local process memory.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.
-
-
Constructor Summary
Constructors Constructor Description InMemoryRepository(DfsRepositoryDescription repoDesc)Initialize a new in-memory repository.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DfsObjDatabasegetObjectDatabase()DfsRefDatabasegetRefDatabase()-
Methods inherited from class org.eclipse.jgit.internal.storage.dfs.DfsRepository
create, exists, getConfig, getDescription, getReflogReader, notifyIndexChanged, scanForRepoChanges
-
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
-
InMemoryRepository
public InMemoryRepository(DfsRepositoryDescription repoDesc)
Initialize a new in-memory repository.- Parameters:
repoDesc- description of the repository.- Since:
- 2.0
-
-
Method Detail
-
getObjectDatabase
public DfsObjDatabase getObjectDatabase()
- Specified by:
getObjectDatabasein classDfsRepository- Returns:
- the object database which stores this repository's data.
-
getRefDatabase
public DfsRefDatabase getRefDatabase()
- Specified by:
getRefDatabasein classDfsRepository- Returns:
- the reference database which stores the reference namespace.
-
-