Class InMemoryRepository

  • All Implemented Interfaces:

    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 Detail

      • InMemoryRepository

        public InMemoryRepository​(DfsRepositoryDescription repoDesc)
        Initialize a new in-memory repository.
        repoDesc - description of the repository.
    • Method Detail

      • getRefDatabase

        public RefDatabase getRefDatabase()
        Get the reference database which stores the reference namespace.
        Specified by:
        getRefDatabase in class Repository
        the reference database which stores the reference namespace.
      • setPerformsAtomicTransactions

        public void setPerformsAtomicTransactions​(boolean atomic)
        Enable (or disable) the atomic reference transaction support.

        Useful for testing atomic support enabled or disabled.

        atomic - whether to use atomic reference transaction support
      • getGitwebDescription

        public String getGitwebDescription()
        Read the GIT_DIR/description file for gitweb.
        getGitwebDescription in class Repository
        description text; null if no description has been configured.
      • setGitwebDescription

        public void setGitwebDescription​(@Nullable
                                         String d)
        Set the GIT_DIR/description file for gitweb.
        setGitwebDescription in class Repository
        d - new description; null to clear the description.